klen / pylama

Code audit tool for python.
MIT License
1.05k stars 99 forks source link

Why does mypy have the '--follow-imports=skip' option? #212

Closed delfick closed 2 years ago

delfick commented 2 years ago

Hello,

It seems the mypy plugin has a '--follow-imports=skip' option given to mypy and it's breaking my setup.

I have prepared an example over here https://github.com/delfick/example-mypy-pylama-problem

Where when I import from within my module mypy thinks the type is Any

delfick commented 2 years ago

I fixed it by creating my own pylama plugin that uses dmypy https://pypi.org/project/pylama-dmypy/ (removing the skip option made it too slow)

Annoyingly a separate bug means I have to make it run dmypy against whole project for each file (https://github.com/python/mypy/issues/11795) but dmypy is fast enough solution for this to be fine.