Skip to content
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

Use PEP 570 syntax in third party stubs #11554

Merged
merged 3 commits into from
Mar 10, 2024
Merged

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Mar 9, 2024

Is it appropriate to merge this? It will probably break people (e.g. anyone using mypy from a year and a half ago that is missing this change python/mypy#13500 even if they've dropped support for 3.7)

Copy link
Contributor

github-actions bot commented Mar 9, 2024

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

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do this. It will only break people who are using very old versions of Python or very old versions of mypy, and users can always pin to an older version of the stubs packages if this causes issues for them.

We should make sure to clearly flag the possible breakage in the commit message, though, so it shows up in the changelog that the stub-uploader autogenerates.

@AlexWaygood
Copy link
Member

AlexWaygood commented Mar 10, 2024

Also — the stub uploader should now be adding requires-python = ">= 3.8" to all our stubs packages. So it should be impossible for people running Python 3.7 to install the latest versions of our stubs packages anyway. It's just the "people who are only using Python 3.8+ but are also using a very old version of mypy" scenario that we really need to worry about here.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've already started using PEP 570 syntax in other places and don't support Python 3.7 anymore.

@srittau srittau merged commit 88fa182 into python:main Mar 10, 2024
43 checks passed
@hauntsaninja hauntsaninja deleted the pep-570-stubs branch March 12, 2024 13:03
dbnicholson added a commit to endlessm/azafea that referenced this pull request Jun 5, 2024
With python >= 3.10.7 and mypy < 0.981[1], type definitions noting
positional only parameters break mypy[2]. Since mypy has been pinned
below 0.920 for pydantic, pin redis and requests to their current
versions until after the pydantic migration.

1. python/mypy#13627
2. python/typeshed#11554
dbnicholson added a commit to endlessm/azafea that referenced this pull request Jun 5, 2024
With python >= 3.10.7 and mypy < 0.981[1], type definitions noting
positional only parameters break mypy[2]. Since mypy has been pinned
below 0.920 for pydantic, pin redis and requests to their current
versions until after the pydantic migration.

1. python/mypy#13627
2. python/typeshed#11554
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