-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Test DebugAdapter requests, and fix issues #17678
Conversation
This was a ~WAG on my part. In the absence of a test it would be great if @CJTurpie could at least confirm by applying the patch in I had and continue to have ~0 context besides this fixed line of code and the base class method it calls, I read and understood no more. |
Certainly specifying the ICs to be compatible with the field set/python default isn't a bad idea. But yes I agree we have no idea if this does fix #17672 without confirmation. @jsirois if you can imagine a scenario where this would an issue (maybe not the linked issue) I can add a test. As it stands, I'm struggling to piece it all together on how to make a failing test. |
@thejcannon I can't see any issue in general but I have no clue about how debugpy works at all. I'd stringly suggest just slowing down and nailing this solid. |
Ah so I figured out how to reproduce by forcing a test's ICs to 3.9, and ensuring Pants itself was running on 3.8 and I can reproduce the error. With as many |
I can confirm that this has fixed #17672 but has thrown up another error after I try to connect VSCode to the debugger.
I think this is a separate issue though so I can open another issue if that's the case? |
Yeah it's a separate issue 😔 One step forward though! |
I just had a great idea on how to test this. Hold on... |
Ah bad merge. Will force push to clean it up since none of the code has been reviewed yet |
a0187b9
to
94bdd3b
Compare
OK @jsirois now there are automated tests that caught the issue (and some others yay). I verified by running with the new test code but |
This is odd. |
Wow this exploded (in a good way). I'll be making some new PRs split out of this one as prereqs.
|
@@ -27,7 +27,7 @@ class DebugPy(PythonToolBase): | |||
default_main = EntryPoint("debugpy") | |||
|
|||
register_interpreter_constraints = True | |||
default_interpreter_constraints = ["CPython>=3.7,<3.11"] | |||
default_interpreter_constraints = ["CPython>=3.7"] |
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 matches the upstream ICs on the package (and the old value was causing a conflicting ICs error)
OK this should be good. I'm really glad we're testing things now. I also opened fabioz/PyDev.Debugger#243 which should simplify the |
I'm going to hold back on review until this thing is green. |
Al flakes, review away! |
We is you! I'm glad too. Thanks for slowing down and doing the right thing here. |
The trick was realizing I could run the debug code by simply monkeypatching the |
Fixes pantsbuild#17672 and fixes pantsbuild#17692 Added new test-code which tests the `DebugAdapterRequest` by running it without `--wait-for-client`. This wouldn't catch issues like pantsbuild#17540 which require a client, but would catches issues like pantsbuild#17672 and pantsbuild#17692. Fixes: - Bad debugpy ICs - Untracked issue where the process would always return 0 - The config wouldn't be used if provided - Removes the reliance on `importlib_metadata` to load the entrypoint, instead re-enters the already executing pex in-process
…17768) Fixes #17672 and fixes #17692 Added new test-code which tests the `DebugAdapterRequest` by running it without `--wait-for-client`. This wouldn't catch issues like #17540 which require a client, but would catches issues like #17672 and #17692. Fixes: - Bad debugpy ICs - Untracked issue where the process would always return 0 - The config wouldn't be used if provided - Removes the reliance on `importlib_metadata` to load the entrypoint, instead re-enters the already executing pex in-process
Fixes #17672 and fixes #17692
Added new test-code which tests the
DebugAdapterRequest
by running it without--wait-for-client
. This wouldn't catch issues like #17540 which require a client, but would catches issues like #17672 and #17692.Fixes:
importlib_metadata
to load the entrypoint, instead re-enters the already executing pex in-process