-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Run stubtest for Python 3.12 #10253
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
Run stubtest for Python 3.12 #10253
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -53,7 +53,7 @@ from typing import ( # noqa: Y022 | |||
overload, | |||
type_check_only, | |||
) | |||
from typing_extensions import ( | |||
from typing_extensions import ( # type: ignore |
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.
These type ignores look like some pretty weird mypy bugginess surrounding LiteralString. I thought probably makes sense to just ignore for now and figure it out later, so we can test 3.12 effectively
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.
Were you using mypy master
when you ran tests locally for this PR? This looks like the regression I reported in python/mypy#15161 (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.
Using mypy 1.3, I don't get any mypy or stubtest errors (on any Python version) if I remove these type: ignore
s, so I think it is the regression I noted in python/mypy#15161 (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.
Ah I'd missed that, it's definitely the same thing. Hmm, I'm not sure what the best way to proceed is.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
.*.__release_buffer__ | ||
|
||
# Removed in 3.12 | ||
distutils\..* |
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.
I would have preferred to not do this. I feel like whenever we've used wildcard regex allowlist entries in the past, it's ended up causing us pain and confusion further down the line (#9900; #10205; there have been others as well).
If we have to do this, then we may as well revert the changes that were made to stubtest_stdlib.py
in #9734. The venv
module is really slow on Windows, so those changes basically doubled the time it takes for me to run the test locally.
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.
I agree in general, but I have basically no further interest in the accuracy of the distutil stubs, especially since most users aren't even going to get distutils when they import distutils
. So that points to undo #9734. But I definitely wouldn't say "we have to do this"... let me know which one you want and I'll make the PR.
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.
Yeah, that all makes sense :-) let's go for undoing #9735, then.
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.
Longer term, I guess we might want to look at getting type checkers to somehow recognise that if a user does import distutils
with setuptools
installed, they'll actually be getting setuptools._distutils
... but the idea of adding that kind of special-casing to type checkers really doesn't fill me with joy.....
Requested by Alex in python#10253
No description provided.