Configuring mypy to use plugins
Plugins are Python files that can be specified in a mypyconfig file using one of the two formats: relative orabsolute path to the plugin to the plugin file, or a module name (if the pluginis installed using pip install
in the same virtual environment where mypyis running). The two formats can be mixed, for example:
- [mypy]
- plugins = /one/plugin.py, other.plugin
Mypy will try to import the plugins and will look for an entry point functionnamed plugin
. If the plugin entry point function has a different name, itcan be specified after colon:
- [mypy]
- plugins = custom_plugin:custom_entry_point
In the following sections we describe the basics of the plugin system withsome examples. For more technical details, please read the docstrings inmypy/plugin.pyin mypy source code. Also you can find good examples in the bundled pluginslocated in mypy/plugins.