Run stubtest for Python 3.12#10253
Conversation
This comment has been minimized.
This comment has been minimized.
| type_check_only, | ||
| ) | ||
| from typing_extensions import ( | ||
| from typing_extensions import ( # type: ignore |
There was a problem hiding this comment.
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.
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.
Using mypy 1.3, I don't get any mypy or stubtest errors (on any Python version) if I remove these type: ignores, so I think it is the regression I noted in python/mypy#15161 (comment)
There was a problem hiding this comment.
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.
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.
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.
Yeah, that all makes sense :-) let's go for undoing #9735, then.
There was a problem hiding this comment.
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.