Skip to content

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

Merged
merged 10 commits into from
Jun 4, 2023
Merged

Conversation

hauntsaninja
Copy link
Collaborator

No description provided.

@github-actions

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
Copy link
Collaborator Author

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

Copy link
Member

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)

Copy link
Member

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: ignores, so I think it is the regression I noted in python/mypy#15161 (comment)

Copy link
Collaborator Author

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja marked this pull request as ready for review June 4, 2023 05:54
@JelleZijlstra JelleZijlstra merged commit 7df870f into python:main Jun 4, 2023
.*.__release_buffer__

# Removed in 3.12
distutils\..*
Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Member

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.....

@hauntsaninja hauntsaninja deleted the py312-stubt branch June 4, 2023 18:57
hauntsaninja added a commit to hauntsaninja/typeshed that referenced this pull request Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants