flake8-mypy
flake8-mypy copied to clipboard
Error running flake8-mypy
When I run flake8, I just get a bunch of these errors and nothing else from mypy:
/home/ubuntu/.local/lib/python3.6/site-packages is in the MYPYPATH. Please remove it.
See https://mypy.readthedocs.io/en/latest/running_mypy.html#how-mypy-handles-imports for more info
Removing the relevant lines in flake8_mypy.py:179 is enough to fix this. I fixed it as well as a few other issues on my fork if you are interested.
I think a workaround is to copy mypy_default.ini
to mypy.ini
in your project folder, and set mypy_config = mypy.ini
in the [flake8]
section of your project's setup.cfg
.
While that workaround gets past the error, it still seems a bit of a mess. If you allow mypy to follow imports, then the violations get duplicated several times, so the output is about 4 times longer than running mypy directly.
Additionally, I'm not sure if there is a setting I've changed, but I'm also seeing these:
routes.py:1:1: T499 Success: no issues found in 1 source file
Which is obviously not the right behaviour.
I have found this plugin works with mypy 0.720 or below.
It would be great if this were fixed here though.