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
Hi I am using mypy:0.782 with python3.5 and I want to use it to check if my imports are valid
for example I would like to raise an error for import PIL # package pillow if its not installed on the build machine.
but mypy complains when installed:
file.py:10: error: Skipping analyzing 'PIL': found module but no type hints or library stubs
file.py:10: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
when not installed:
file.py.py:10: error: Cannot find implementation or library stub for module named 'PIL'
file.py:10: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
when adding #type: ignore all errors are ignored for this package, but I would like to surpress only the missing library stubs but
raise an error if the module is not found at all. I can't find a flag for that purpose.
Error codes are meant for things like this except that the error code is [import] in both cases
Maybe one of the error codes should be module-not-found and the other should be stubs-not-found, or something like that? then you could do # type: ignore[stubs-not-found]
Hi I am using mypy:0.782 with python3.5 and I want to use it to check if my imports are valid
for example I would like to raise an error for
import PIL # package pillow
if its not installed on the build machine.but mypy complains when installed:
when not installed:
when adding
#type: ignore
all errors are ignored for this package, but I would like to surpress only the missing library stubs butraise an error if the module is not found at all. I can't find a flag for that purpose.
mypy config:
The text was updated successfully, but these errors were encountered: