Skip to content
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

Generated Protobuf library code is not compatible with typeshed's protobuf type stubs #21

Open
thundergolfer opened this issue Jul 12, 2020 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@thundergolfer
Copy link
Collaborator

Not too confident this will be easily fixed on the typeshed side -> python/typeshed#2521

@thundergolfer
Copy link
Collaborator Author

thundergolfer commented Jul 12, 2020

✝️ 👨🏾‍⚕️

I think I've got a 'bandaid' solution. Add the following to the mypy.ini:

[mypy-google.protobuf.*]
follow_imports_for_stubs = True
follow_imports = skip

making sure that that config is placed above any more general config like what's shown below.

[mypy-google.*]
ignore_missing_imports = True

The effect is that the (incorrect) protobuf typeshed stubs aren't looked at, and thus the errors within don't break our builds. The relevant piece of the MyPy docs are:

Used in conjunction with follow_imports=skip, this can be used to suppress the import of a module from typeshed, replacing it with Any.

@thundergolfer thundergolfer added the help wanted Extra attention is needed label Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant