-
-
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
Bump typing_extensions dependency #15488
Conversation
I checked for other imports using this script: import ast
import itertools
import pathlib
names = set[str]()
class ImportFinder(ast.NodeVisitor):
def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
self.generic_visit(node)
if node.module != "typing_extensions":
return
names.update({obj.name for obj in node.names})
def visit_Attribute(self, node: ast.Attribute) -> None:
self.generic_visit(node)
match node:
case ast.Attribute(ast.Name("typing_extensions"), attr):
names.add(attr)
case _:
pass
for path in itertools.chain(
pathlib.Path("mypy").rglob("*.py"),
pathlib.Path("mypyc").rglob("*.py")
):
ImportFinder().visit(ast.parse(path.read_text()))
print(names) The |
Co-authored-by: Alex Waygood <[email protected]>
@@ -222,7 +222,7 @@ def run(self): | |||
# When changing this, also update mypy-requirements.txt. |
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.
We should probably also update mypy-requirements.txt
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.
LGTM, thanks!
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
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 all!
Co-authored-by: Alex Waygood <[email protected]>
Mypy started using
typing_extensions.Self
which is only available in>=4.0.0
.https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#release-401-november-30-2021
Fixes: #15487