-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add support for pydevd debugging of modules #75
Add support for pydevd debugging of modules #75
Conversation
curious in general - does VSC already support debugging modules (via ptvsd/debugpy)? |
LGTM. review became easy after you showed the command sequence above. just a comment to add those details somewhere as a comment in the code. |
switch { | ||
case len(args) == 0: | ||
return "", nil, fmt.Errorf("no python command-line specified") // shouldn't happen | ||
case !strings.HasPrefix(args[0], "-"): |
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.
what if it's something like python -[some-other-flag] app.py
? is this not valid? In that case it wouldn't be recognized as a file
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.
if I update my entrypoint to this ENTRYPOINT ["python", "-E", "app.py"]
debug suddenly breaks (it works without the -E
flag. And non-debug mode works with either.
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.
update: I may have been wrong here. running another test. will update this comment
update 2: nevermind, looks like my observation above was correct.
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.
It does break. That's going to be more involved — I'll do tackle it as a follow-up.
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.
sg.
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.
This PR builds on #74 and adds support for debugging Python modules (e.g.,
python -m flask
) withpydevd
. Just look at ef3a44apydevd ... --file xxx
expects the--file
argument to be a file. This patch causes the python launcher to create a small launch script that uses Python'srunpy
support to launch the module.