Open hatal175 opened 2 years ago
Hey and thanks for the hint. I actually didn't know about the py.typed
marker and thought that MyPy would pick up type hints automatically. So it is enough to create an empty py.typed
file and include it in package_data
in setup.py
?
I think so
A py.typed
marker is added in commit be7b3a947122c236218b24fa7eb3027c0532fe4e. However, this won't work at the moment. :disappointed: PEP561 mentions:
This PEP does not support distributing typing information as part of module-only distributions or single-file modules within namespace packages.
The single-file module should be refactored into a package and indicate that the package supports typing as described above.
So, as long as this project is a single-module project, no py.typed
marker will be installed and thus, MyPy won't detect the typing support. I plan to restructure the project anyway to support Windows, so I can merge this change later...
Thanks for the response! Up to you whether to keep the issue open or not.
On Wed, Apr 27, 2022, 17:20 Ingo Meyer @.***> wrote:
A py.typed marker is added in commit be7b3a947122c236218b24fa7eb3027c0532fe4e. However, this won't work at the moment. 😞 PEP561 mentions:
This PEP does not support distributing typing information as part of module-only distributions or single-file modules within namespace packages.
The single-file module should be refactored into a package and indicate that the package supports typing as described above.
So, as long as this project is a single-module project, no py.typed marker will be installed and thus, MyPy won't detect the typing support. I plan to restructure the project anyway to support Windows, so I can merge this change later...
— Reply to this email directly, view it on GitHub https://github.com/IngoMeyer441/simple-term-menu/issues/47#issuecomment-1111062376, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYQXXKAI3GISDFUWJL4FLLVHFEJBANCNFSM5UOBMPAA . You are receiving this because you authored the thread.Message ID: @.***>
You went through the trouble of typing your package - adding a py.typed file to it will help type analysis.