I am using a package that does not provide its own type hints so I have built some but cannot see how to get mypy
to use them – anyone able to help? Here’s my system:
- Windows
- Using poetry
- Created type hint files
*.pyi
for external packagebob
- If I use
poetry env info
to locate thesite-packages
directory and in there create a directorybob-stubs
and copy my*.pyi
type hints, thenmypy
is happy, but this is hacky of course! - If I create a
typingsbob-stubs
directory in my own package and copy the*.pyi
files there, thenmypy
appears to try and type check the typing hints (!) and throws new errors! - If I move the type hint files elsewhere and try to set
mypy_path
in amypy.ini
file, I can seemypy
read themypy.ini
file (using-vv
) but it seems to ignore the hint files.
I’ve been going around in circles trying get this to work – anyone able to point me in the right directions?