mypy --follow-imports=skip myproj/foo.py myproj/bar.py
mypy --follow-imports=skip myproj/sub/ myproj/sub2
MyPy single file options
MyPy is a strongly recommended type checker, though others exist. We typically use a per-project .mypy.ini to configure MyPy default behavior. To tell MyPy to only check certain files, use the MyPy –follow-imports= option like:
mypy --follow-imports=skip myproj/foo.py myproj/bar.py
Only certain directories can be checked like:
mypy --follow-imports=skip myproj/sub/ myproj/sub2
Once the type checks pass via mypy --follow-imports=skip, we recommend trying
mypy --follow-imports=silent
to improve robustness of the type check for those files / directories.