-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode Logging #506
base: main
Are you sure you want to change the base?
VSCode Logging #506
Conversation
for more information, see https://pre-commit.ci
…into vscode-integration
for more information, see https://pre-commit.ci
…into vscode-integration
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #506 +/- ##
==========================================
- Coverage 97.80% 97.61% -0.20%
==========================================
Files 106 110 +4
Lines 8710 9219 +509
==========================================
+ Hits 8519 8999 +480
- Misses 191 220 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I added the logging code for the task execution to the hook in live.py, but this seems a bit odd considering the project structure. I could move it to a new implementation of the hook in logging.py that uses |
Hi @mj023, thanks for your effort!
|
src/_pytask/collect.py
Outdated
for task in tasks | ||
] | ||
thread = Thread( | ||
target=send_logging_vscode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the daemon
keyword for threads and see whether it might be helpful in our situation.
src/_pytask/live.py
Outdated
@@ -168,6 +171,27 @@ def pytask_execute_task_log_start(self, task: PTask) -> bool: | |||
@hookimpl | |||
def pytask_execute_task_log_end(self, report: ExecutionReport) -> bool: | |||
"""Mark a task as being finished and update outcome.""" | |||
if report.outcome == TaskOutcome.FAIL and report.exc_info is not None: | |||
with console.capture() as capture: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out render_to_string
from console.py
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…into vscode-integration
for more information, see https://pre-commit.ci
…into vscode-integration
for more information, see https://pre-commit.ci
…into vscode-integration
for more information, see https://pre-commit.ci
…into vscode-integration
for more information, see https://pre-commit.ci
…into vscode-integration
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
I think everything should be ready now, but I'm having a little trouble writing the tests. I have moved the code to a new vscode.py module, replaced the requests library with the standard urllib and added a guard so the code is only executed if a specific environment variable is set. I then added two new tests, so that almost everything I added is covered, but I'm not sure if I did that correctly. Furthermore the tests on ubuntu 3.12 now failed and I can not figure out why. |
…into vscode-integration
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Changes
Add additional logging for the VSCode Extension.