Basic usage

The client utility dmypy is used to control the mypy daemon.Use dmypy run — <flags> <files> to typecheck a set of files(or directories). This will launch the daemon if it is not running.You can use almost arbitrary mypy flags after . The daemonwill always run on the current host. Example:

  1. dmypy run -- --follow-imports=error prog.py pkg1/ pkg2/

Note

You’ll need to use either the —follow-imports=error or the—follow-imports=skip option with dmypy because the currentimplementation can’t follow imports.See Following imports for details on how these work.You can also define these using aconfiguration file.

dmypy run will automatically restart the daemon if theconfiguration or mypy version changes.

You need to provide all files or directories you want to type check(other than stubs) as arguments. This is a result of the—follow-imports restriction mentioned above.

The initial run will process all the code and may take a while tofinish, but subsequent runs will be quick, especially if you’ve onlychanged a few files. You can use remote cachingto speed up the initial run. The speedup can be significant ifyou have a large codebase.