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

Fix tests on 3.7 #15543

Merged
merged 1 commit into from
Jun 29, 2023
Merged

Fix tests on 3.7 #15543

merged 1 commit into from
Jun 29, 2023

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jun 28, 2023

Fixes #15542

This fixes tests for me locally, but the situation will still be problematic, in that things won't work on 3.7 if you have this code and have older typing-extensions, or if you don't have this code and you have newer typing-extensions.

Given that 3.7 is dead, I'm not sure we need to care much, but this will hopefully get CI green for now.

@@ -498,6 +498,9 @@ def populate_non_ext_bases(builder: IRBuilder, cdef: ClassDef) -> Value:
if builder.options.capi_version < (3, 8):
# TypedDict was added to typing in Python 3.8.
module = "typing_extensions"
# It needs to be "_TypedDict" on typing_extensions 4.7.0+
# and "TypedDict" otherwise.
Copy link
Member

Choose a reason for hiding this comment

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

If this breaks tests with typing_extensions <4.7 installed, should we bump the typing_extensions lower bounds here to >=4.7.0?

mypy/setup.py

Line 225 in 9a4a5aa

"typing_extensions>=4.1.0",

typing_extensions>=4.1.0

"typing_extensions>=4.1.0",

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly, but I think it also breaks usage of mypyc-compiled extensions that have typing-extensions 4.7 lying around, which I don't think is something we can guard against.

Copy link
Member

Choose a reason for hiding this comment

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

I see. I think it still might be worth bumping the lower bound, though — it will affect freshly compiled extensions. People got unhappy with us when we started using features added in typing_extensions 4.1 without bumping our lower bound: #15487.

(I do agree with you that dropping support for 3.7 is probably the best solution here FWIW.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess my preference is: merge this PR now to get CI green (assuming it actually passes). If we still support 3.7 on the next release, bump the typing-extensions lower bounds, otherwise don't.

Copy link
Member

@AlexWaygood AlexWaygood Jun 28, 2023

Choose a reason for hiding this comment

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

That makes sense, but we need to make sure we remember to do that if we are still supporting 3.7 at that point!

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@hauntsaninja hauntsaninja merged commit 05c81d6 into python:master Jun 29, 2023
@JelleZijlstra JelleZijlstra deleted the td branch June 29, 2023 00:54
JukkaL pushed a commit that referenced this pull request 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.
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.

Mypyc TypedDict tests broken on master by typing_extensions 4.7.0
3 participants