-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix tests on 3.7 #15543
Conversation
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing!
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.
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.