-
Notifications
You must be signed in to change notification settings - Fork 171
Add parsing args from environment #1624
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
…nt. Add some tests.
This comment was marked as resolved.
This comment was marked as resolved.
@@ -71,7 +82,7 @@ def test_targets(cli, target_kind, mode, address, wait_for_client, script_args): | |||
expected_options = { | |||
"mode": mode, | |||
"target_kind": target_kind, | |||
"wait_for_client": bool(wait_for_client), | |||
"wait_for_client": False |
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 seems off? The parameter is being skipped now?
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 was just a refactor with no functional difference. It defaults to false, so in the case of the empty string, the conditional on line 96 will eval to false. But in the case where it has a value, line 96 will eval to true, and the default value will be overridden on line 98.
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Fixes #1612
Testing was done in several ways:
I verified that these extra args were passed to the file being run and that breakpoints could be hit. I also verified that this worked with no args.
python E:\repos\github\debugpy\src\debugpy --listen 5678 --wait-for-client "C:\Users\advolker\OneDrive - Microsoft\Desktop\pythonTest\infiniteLoop.py"
Then I attached through vscode using the following launch.json config:
Breakpoints worked just fine.
--listen 5678
and--wait-for-client
in the environment before running debugpy, like this:set DEBUGPY_EXTRA_ARGV=--listen 5678 --wait-for-client
Then I started debugpy from the same command prompt with only the target specified. The other options were read from the environment:
python E:\repos\github\debugpy\src\debugpy "C:\Users\advolker\OneDrive - Microsoft\Desktop\pythonTest\infiniteLoop.py"
Then I attached through vscode in the same way as the previous step. Breakpoints worked just fine.