-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Update mypy to 1.11.0 #2269
Update mypy to 1.11.0 #2269
Conversation
When updating mypy to 1.11.0 in typeddjango/django-stubs#2269 I noticed this: ``` ______________________________ import_all_modules ______________________________ /home/runner/work/django-stubs/django-stubs/tests/typecheck/test_import_all.yml:2: E pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: E Actual: E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:87: error: Signature of "find_python_module" incompatible with supertype "FullConstructor" [override] (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:87: note: Superclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:87: note: def find_python_module(self, name: Any, mark: Any, unsafe: Any = ...) -> Any (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:87: note: Subclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:87: note: def find_python_module(self, name: Any, mark: Any) -> Any (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:88: error: Signature of "find_python_name" incompatible with supertype "FullConstructor" [override] (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:88: note: Superclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:88: note: def find_python_name(self, name: Any, mark: Any, unsafe: Any = ...) -> Any (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:88: note: Subclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:88: note: def find_python_name(self, name: Any, mark: Any) -> Any (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:89: error: Signature of "make_python_instance" incompatible with supertype "FullConstructor" [override] (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:89: note: Superclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:89: note: def make_python_instance(self, suffix: Any, node: Any, args: Any = ..., kwds: Any = ..., newobj: Any = ..., unsafe: Any = ...) -> Any (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:89: note: Subclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:89: note: def make_python_instance(self, suffix: Any, node: Any, args: Any = ..., kwds: Any = ..., newobj: Any = ...) -> Any (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:90: error: Signature of "set_python_instance_state" incompatible with supertype "FullConstructor" [override] (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:90: note: Superclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:90: note: def set_python_instance_state(self, instance: Any, state: Any, unsafe: bool = ...) -> None (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:90: note: Subclass: (diff) E ../../opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/yaml-stubs/constructor.pyi:90: note: def set_python_instance_state(self, instance: Any, state: Any) -> Any (diff) E Expected: E (empty) =========================== short test summary info ============================ ``` This happens because `UnsafeConstructor` has unsafe method overrides and new mypy detects this. So, I added just some simple annotations so it can detect it now as well.
Blocked by python/typeshed#12404 |
Could perhaps this breakage bring an argument to include |
cc @hauntsaninja |
Yeah, PR welcome! |
Hi! Thanks a lot for the work! I can see Thanks! |
It is not created, I just added it to the docs, so we won't forget. @flaeppe maybe we should make a new release? |
Sounds good, I've opened #2274 |
Closes #2267