This is more of a question than an issue.
I'm starting on using mypyand here's the minimal version of the project I'm type hinting - https://github.com/waseem18/mypy
We planned to have .pyi stubs of each python file separately in a folder named stubs and give the path to stubs folder in mypy.ini file.
I learnt from this stack overflow answer that the stub file works only when importing a module. So I wrote a basic test file in tests folder which basically imports and calls the methods present in mypy/main.py.
When I run mypy tests/test-main.py I get
mypy/main.py:1: error: Function is missing a type annotation
mypy/main.py:5: error: Function is missing a type annotation
mypy/main.py:9: error: Function is missing a type annotation
Though I gave path to stubs folder in mypy.ini file I believe mypy is still not considering stubs/mypy/main.pyi file. If stubs/mypy/main.pyi is considered it should throw me some errors as some of the returns types mentioned in main.pyi are incorrect.
Can someone please help me in knowing where am I exactly going wrong? In other words how do I place .pyi files in a separate folder and run mypy?
Just to point out, if both main.py and main.pyi are in same folder things are working.
Thanks
This is more of a question than an issue.
I'm starting on using
mypyand here's the minimal version of the project I'm type hinting - https://github.com/waseem18/mypyWe planned to have
.pyistubs of each python file separately in a folder namedstubsand give the path to stubs folder inmypy.inifile.I learnt from this stack overflow answer that the stub file works only when importing a module. So I wrote a basic test file in
testsfolder which basically imports and calls the methods present inmypy/main.py.When I run
mypy tests/test-main.pyI getmypy/main.py:1: error: Function is missing a type annotationmypy/main.py:5: error: Function is missing a type annotationmypy/main.py:9: error: Function is missing a type annotationThough I gave path to stubs folder in
mypy.inifile I believemypyis still not consideringstubs/mypy/main.pyifile. Ifstubs/mypy/main.pyiis considered it should throw me some errors as some of the returns types mentioned inmain.pyiare incorrect.Can someone please help me in knowing where am I exactly going wrong? In other words how do I place
.pyifiles in a separate folder and runmypy?Just to point out, if both
main.pyandmain.pyiare in same folder things are working.Thanks