-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix stdlib/disutils
testing
#9734
Conversation
This comment has been minimized.
This comment has been minimized.
In its current state, this PR shows that the tests are run correctly on all version. Which I wanted to demo. |
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
LGTM. @hauntsaninja, does this seem like a reasonable approach to you? It involves adding a little bit of complexity to stubtest_stdlib.py
, but I think it's worth it.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
(only looked at stubtest_stdlib)
Approach looks fine, but let's remove the return code logic from the pip commands. We only care about preserving the stubtest return code, we don't care about pip's return codes. I'd also not capture output from those installs.
Diff from mypy_primer, showing the effect of this PR on open source code: pip (https://github.com/pypa/pip)
+ src/pip/_internal/locations/_distutils.py:60: error: Unused "type: ignore" comment
|
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.
Thanks, changes to stubtest_stdlib.py lgtm!
Requested changes were made
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.
Thank you!
Hmm, are you sure about that @hauntsaninja? The output from pip is now pretty noisy when I run
I'd find the output easier to parse if we suppressed |
In hindsight the solution was quite simple: Just don't have setuptools installed in a test environment.
Turned on stubtest for distutils for python 3.10+
Fixed enough stubtest to get the CI green.
Missing variables and functions were added with stubgen. Then filled in necessary types for pyright to pass.
Solves one of the two concerns raised in #9520 (namely distutils being a mess to test, and untestable on 3.10+)
As for the second one:
distutils
shouldn't be imported with setuptools>=60 installed. But even if we wanted to support that use-case, we could.