-
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
Open
mj023
wants to merge
61
commits into
pytask-dev:main
Choose a base branch
from
mj023:vscode-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
VSCode Logging #506
Changes from 12 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
d42d176
Added Logging for Vscode
mj023 ef10aab
Fixed mistake in json
mj023 ed38f14
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a513fa5
Moved execution logging to live.py
mj023 b613a75
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 5f7b80a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7846dee
added requests as dependency
mj023 d051db6
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 ceed57f
Add Func description
mj023 28a43e9
add requests to mypy
mj023 bb59416
Check for no exec info
mj023 bb1af38
suppress more exceptions
mj023 4ef51b0
Add new vscode module
mj023 945e933
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 24623fd
Suppress exceptions
mj023 8d5ca61
Remove old code
mj023 7db35cf
Remove Changes
mj023 1415d38
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d0087a6
Merge branch 'pytask-dev:main' into vscode-integration
mj023 4ad1d36
Add vscode module
mj023 ec09e60
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1722f1c
Fix URL error
mj023 3c188b5
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 224331f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c856264
Check URL
mj023 c7de595
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 7d7bf21
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e5d38f9
Disable qa
mj023 e6d1156
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 b9af139
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b0aba34
Add noqa
mj023 208249b
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 5a28ed6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2956580
change noqa
mj023 3166c8d
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 573d39a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c1418c3
Merge branch 'main' into vscode-integration
mj023 f8945a7
Merge branch 'pytask-dev:main' into vscode-integration
mj023 2a856b2
Add tests for vscode module
mj023 ba12e7b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a6c2dc9
Merge branch 'main' into vscode-integration
mj023 4d335d4
Send Logging to different urls
mj023 f2de23f
Merge branch 'vscode-integration' of https://github.com/mj023/pytask …
mj023 a3db9ae
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4c68723
Merge branch 'pytask-dev:main' into vscode-integration
mj023 2e28de7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1cd6281
Merge branch 'main' into vscode-integration
mj023 cde73fd
Make Port changeable
mj023 f4b1808
Fix typing mistake
mj023 57596b9
Merge branch 'main' into vscode-integration
mj023 c17208d
Merge branch 'main' into vscode-integration
mj023 698519b
Add Test for Wrong EnvVar
mj023 9ef1305
Add Comments for new functions
mj023 e3ef562
Update vscode.py
timmens 9afa75b
Add Unit Test
mj023 686cdbe
Unfinished changes from discussion
timmens bef8004
Refactor Port Validation; Docstrings
mj023 a79c101
Add Mocking to Tests
mj023 450ab7e
Fix mypy error
timmens da70cca
Merge pull request #1 from mj023/updates-tim
mj023 e5f1f99
Merge branch 'main' into vscode-integration
mj023 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ repos: | |
click, | ||
optree, | ||
pluggy, | ||
types-requests, | ||
rich, | ||
sqlalchemy, | ||
types-setuptools, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
"""Contains code related to live objects.""" | ||
from __future__ import annotations | ||
|
||
from threading import Thread | ||
from typing import Any | ||
from typing import Generator | ||
from typing import NamedTuple | ||
from typing import TYPE_CHECKING | ||
|
||
import click | ||
from _pytask.collect import send_logging_vscode | ||
from _pytask.config import hookimpl | ||
from _pytask.console import console | ||
from _pytask.console import format_task_name | ||
from _pytask.outcomes import CollectionOutcome | ||
from _pytask.outcomes import TaskOutcome | ||
from _pytask.traceback import Traceback | ||
from attrs import define | ||
from attrs import field | ||
from rich.box import ROUNDED | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Check out |
||
console.print(Traceback(report.exc_info)) | ||
s = capture.get() | ||
result = { | ||
"type": "task", | ||
"name": report.task.name.split("/")[-1], | ||
"outcome": str(report.outcome), | ||
"exc_info": s, | ||
} | ||
else: | ||
result = { | ||
"type": "task", | ||
"name": report.task.name.split("/")[-1], | ||
"outcome": str(report.outcome), | ||
} | ||
thread = Thread( | ||
target=send_logging_vscode, | ||
args=("http://localhost:6000/pytask", result, 0.00001), | ||
) | ||
thread.start() | ||
self.update_reports(report) | ||
return True | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.