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
{{ message }}
Repository navigation
types-boto 2.49.18.20240205 regression: boto.iam.connection import triggers an error saying I need to install types-boto, which is already installed #11381
With types-boto==2.49.18.9 and boto==2.49.0 installed in my virtual environment, I am able to typecheck code that does this:
from boto.iam.connection import IAMConnection
If I make a fresh virtual environment and install the current types-boto==2.49.18.20240205 instead, it no longer typechecks. It thinks that the boto stubs are not installed, when actually they are.
test.py:1: error: Library stubs not installed for "boto.iam.connection" [import-untyped]
test.py:1: note: Hint: "python3 -m pip install types-boto"
test.py:1: note: (or run "mypy --install-types" to install all missing stub packages)
test.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
There also seems to be something not quite right with MyPy's caching: if in the failing environment I install the old working stubs, typecheck, and then install the new stubs, suddenly the type checking passes with the new stubs installed. It only fails if they are installed in a fresh virtual environment, or if I try to typecheck after uninstalling the old stubs and before installing the new ones.
(venv2) [anovak@swords type-test]% mypy --strict test.py
test.py:1: error: Library stubs not installed for "boto.iam.connection" [import-untyped]
test.py:1: note: Hint: "python3 -m pip install types-boto"
test.py:1: note: (or run "mypy --install-types" to install all missing stub packages)
test.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
(venv2) [anovak@swords type-test]% pip install --upgrade types-boto==2.49.18.9
Collecting types-boto==2.49.18.9
Using cached types_boto-2.49.18.9-py3-none-any.whl.metadata (1.5 kB)
Using cached types_boto-2.49.18.9-py3-none-any.whl (23 kB)
Installing collected packages: types-boto
Attempting uninstall: types-boto
Found existing installation: types-boto 2.49.18.20240205
Uninstalling types-boto-2.49.18.20240205:
Successfully uninstalled types-boto-2.49.18.20240205
Successfully installed types-boto-2.49.18.9
[notice] A new release of pip is available: 23.3.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
(venv2) [anovak@swords type-test]% mypy --strict test.py
Success: no issues found in 1 source file
(venv2) [anovak@swords type-test]% pip install --upgrade types-boto==2.49.18.20240205
Collecting types-boto==2.49.18.20240205
Using cached types_boto-2.49.18.20240205-py3-none-any.whl.metadata (1.7 kB)
Using cached types_boto-2.49.18.20240205-py3-none-any.whl (24 kB)
Installing collected packages: types-boto
Attempting uninstall: types-boto
Found existing installation: types-boto 2.49.18.9
Uninstalling types-boto-2.49.18.9:
Successfully uninstalled types-boto-2.49.18.9
Successfully installed types-boto-2.49.18.20240205
[notice] A new release of pip is available: 23.3.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
(venv2) [anovak@swords type-test]% mypy --strict test.py
Success: no issues found in 1 source file
This seems to be a mypy problem. The new stubs include a py.typed marker set to "partial", which is true, since e.g. the stubs for boto.iam are missing. Mypy should merge the stubs with the implementation. In fact, the old stubs should have made mypy print an error, while the new stubs should work. See the typing spec for details. The weird caching behavior is another indicator that something wonky is going on with mypy.
Activity
Work around boto stubs regression in python/typeshed#11381
srittau commentedon Feb 8, 2024
This seems to be a mypy problem. The new stubs include a py.typed marker set to "partial", which is true, since e.g. the stubs for boto.iam are missing. Mypy should merge the stubs with the implementation. In fact, the old stubs should have made mypy print an error, while the new stubs should work. See the typing spec for details. The weird caching behavior is another indicator that something wonky is going on with mypy.
Fix special characters in filenames with the FileJobStore (#4781)
srittau commentedon Feb 9, 2024
Thanks for reporting this on the mypy issue tracker.
Merging with upstream (#1)