Import discovery

For more information, see the Import discoverysection of the command line docs.

  • mypy_path (string)
  • Specifies the paths to use, after trying the paths from MYPYPATH environmentvariable. Useful if you’d like to keep stubs in your repo, along with the config file.Multiple paths are always separated with a : or , regardless of the platform.User home directory and environment variables will be expanded.

This option may only be set in the global section ([mypy]).

Note: On Windows, use UNC paths to avoid using : (e.g. \127.0.0.1\X$\MyDir where X is the drive letter).

  • files (comma-separated list of strings)
  • A comma-separated list of paths which should be checked by mypy if none are given on the commandline. Supports recursive file globbing using glob, where (e.g. .py) matchesfiles in the current directory and / (e.g. /*.py) matches files in any directories belowthe current one. User home directory and environment variables will be expanded.

This option may only be set in the global section ([mypy]).

This option may only be set in the global section ([mypy]).

  • ignore_missing_imports (bool, default False)
  • Suppresses error messages about imports that cannot be resolved.

If this option is used in a per-module section, the module name shouldmatch the name of the imported module, not the module containing theimport statement.

  • follow_imports (string, default normal)
  • Directs what to do with imports when the imported module is foundas a .py file and not part of the files, modules and packagesprovided on the command line.

The four possible values are normal, silent, skip anderror. For explanations see the discussion for the–follow-imports command line flag.

If this option is used in a per-module section, the module name shouldmatch the name of the imported module, not the module containing theimport statement.

  • follow_imports_for_stubs (bool, default False)
  • Determines whether to respect the follow_imports setting even forstub (.pyi) files.

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

Used in conjunction with follow_imports=error, this can be usedto make any use of a particular typeshed module an error.

  • python_executable (string)
  • Specifies the path to the Python executable to inspect to collecta list of available PEP 561 packages. Userhome directory and environment variables will be expanded. Defaults tothe executable used to run mypy.

This option may only be set in the global section ([mypy]).

  • no_silence_site_packages (bool, default False)
  • Enables reporting error messages generated within PEP 561 compliant packages.Those error messages are suppressed by default, since you are usuallynot able to control errors in 3rd party code.

This option may only be set in the global section ([mypy]).