-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
Description
These two (very basic) test cases fail (these test that --follow-imports=skip does not imply --ignore-missing-imports):
[case testAddedMissingModuleSkip]
# flags: --follow-imports=skip
import mod
[file mod.py.2]
[out]
main:2: error: Cannot find implementation or library stub for module named "mod"
main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
[out2]
[case testDeletedModuleSkip]
# flags: --follow-imports=skip
import mod
[file mod.py]
[delete mod.py.2]
[out]
[out2]
main:2: error: Cannot find implementation or library stub for module named "mod"
main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
In general, we have very few test cases for --follow-imports=skip when modules are not on command line. In this case the problem is that in both cases main is considered fresh, because mod is still suppressed, and the import options for mod are unchanged. But suppression reason is different (intentionally skipped vs actually missing). I think this may be fixed by adding suppression reason to suppressed_deps_opts() hash.
Btw we may want to micro-optimize that one as well for large code bases that use --follow-imports=skip, LOL. I can do this while fixing this issue cc @JukkaL
Reactions are currently unavailable