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

Enforce typing_extensions >=4.7.0 on py37 #15556

Merged
merged 2 commits into from
Jun 30, 2023
Merged

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jun 30, 2023

The changes made in #15543 mean that mypy's tests will no longer pass if you've got typing_extensions<4.7 installed and you're running on Python 3.7. But if we go with this solution instead, our tests will pass on Python 3.7 regardless of whether you have typing_extensions==4.6.3 or typing_extensions==4.7.0 installed. (I've verified this locally.)

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Does this mean that we can compile on 3.7 while targeting typing_extensions <4.7.0, but the compiled module won't work with a more recent typing_extensions? It would be nicer if the generated code would work with different versions of typing_extensions, but that's likely not worth it since we'll drop 3.7 soon enough.

What about instead generating an error here from mypyc if typing_extensions is older than 4.7.0, with the suggestion to use a newer typing_extensions? Mypyc is considered experimental so we don't need to support older typing_extension versions here, I think. Or would this cause other problems?

@AlexWaygood
Copy link
Member Author

Does this mean that we can compile on 3.7 while targeting typing_extensions <4.7.0, but the compiled module won't work with a more recent typing_extensions?

Hmm, I suppose so. And yes, that doesn't sound good, agreed.

I don't think it's essential for us to support older typing_extensions versions, but I don't much like the current state of affairs where we don't support older versions of typing_extensions on Python 3.7, but still claim to support them here:

mypy/setup.py

Line 225 in b995e16

"typing_extensions>=4.1.0",

@AlexWaygood AlexWaygood marked this pull request as draft June 30, 2023 09:26
@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@AlexWaygood AlexWaygood changed the title Restore compatibility with typing_extensions <4.7.0 Enforce typing_extensions >=4.7.0 on py37 Jun 30, 2023
@AlexWaygood AlexWaygood marked this pull request as ready for review June 30, 2023 10:23
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks! This seems like a reasonable (temporary) workaround until we drop support for 3.7.

@JukkaL JukkaL merged commit 21beadc into python:master Jun 30, 2023
@AlexWaygood AlexWaygood deleted the alt-fix branch June 30, 2023 15:43
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.

2 participants