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
extensions_pb2.pyi:7: error: Cannot find implementation or library stub for module named "google" [import-not-found]
extensions_pb2.pyi:7: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
By itself, this doesn't really matter to us, since we ignore all errors in the generated _pb2.pyi files anyway, but typechecking anything from the generated files with --strict errors because everything is typed as Any, e.g. MyEnum.Value("foo") # Any
The text was updated successfully, but these errors were encountered:
brandonchinn178
changed the title
Imports in generated files don't work
Imports in generated files aren't findable by mypy
Apr 4, 2025
Maybe I'm not installing the tool right, but I'm getting type errors on the import statements that mypy-protobuf generates.
Repro steps:
python3 -m venv venv
venv/bin/pip install mypy types-protobuf
venv/bin/mypy extensions_pb2.pyi
Related to python/mypy#16149
By itself, this doesn't really matter to us, since we ignore all errors in the generated
_pb2.pyi
files anyway, but typechecking anything from the generated files with--strict
errors because everything is typed asAny
, e.g.MyEnum.Value("foo") # Any
The text was updated successfully, but these errors were encountered: