You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
requests 2.31.0 depends on urllib3, and supports both urllib3 1.21.x and urllib3 2.0.x. requests does not have inline type hints. urllib3 1.x did not have inline type hints, we introduced them in urllib3 2.0, as correctly identified here:
mypy --strict t.py reports no error, unless I run pip install types-requests, which installs types-requests 2.31.0.6 AND types-urllib3 1.26.25.14. At this point, the typeshed package takes precedence even if I'm using urllib3 2.0.5 at runtime, and mypy --strict t.py reports:
t.py:6: error: Call to untyped function "connect" in typed context [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)
The manual fix is to manually uninstall types-urllib3, but is there a way to make this work without manual intervention?
The text was updated successfully, but these errors were encountered:
We'd like to change our types-requests package so that it depends on urllib3 rather than types-urllib3. Unfortunately, doing so breaks our tests due to a limitation of how our CI is set up -- our tests start complaining about differences between our outdated stubs for urllib3 and the inline types in the runtime package for urllib3, and it's all a bit of a mess.
However, good news! In four days, we're due to remove our stubs for urllib3 from typeshed (#6898). Once we do so, we can easily change types-requests so that it depends on urllib3 rather than types-urllib3, which will resolve this issue for you.
requests 2.31.0 depends on urllib3, and supports both urllib3 1.21.x and urllib3 2.0.x. requests does not have inline type hints. urllib3 1.x did not have inline type hints, we introduced them in urllib3 2.0, as correctly identified here:
typeshed/stubs/urllib3/METADATA.toml
Line 3 in 4dad531
However, when taking advantages of urllib3 2.0 type hints in a file like this:
mypy --strict t.py
reports no error, unless I runpip install types-requests
, which installs types-requests 2.31.0.6 AND types-urllib3 1.26.25.14. At this point, the typeshed package takes precedence even if I'm using urllib3 2.0.5 at runtime, andmypy --strict t.py
reports:The manual fix is to manually uninstall types-urllib3, but is there a way to make this work without manual intervention?
The text was updated successfully, but these errors were encountered: