Mypy only considers the type annotations of packages that contain the py.typed marker file, even if they are fully type-annotated (like pybreaker). See https://peps.python.org/pep-0561/
This PR adds said file.
I had to move pybreaker into a module instead of a single .py file, because there is no support for py.typed files for single .py file packages yet (see https://github.com/python/typing/issues/1333).
Ran python setup.py test to ensure the tests still pass.
Ran python -m build to build the package.
Observe the output logs to see that py.typed was included.
Install the tarball into a project where I have mypy set up. Run mypy and observe mypy now no longer fails with ... becomes "Any" due to an unfollowed import [error/no-any-unimported] for imports from pybreaker.
Summary
Mypy only considers the type annotations of packages that contain the
py.typed
marker file, even if they are fully type-annotated (likepybreaker
). See https://peps.python.org/pep-0561/This PR adds said file.
I had to move
pybreaker
into a module instead of a single .py file, because there is no support forpy.typed
files for single .py file packages yet (see https://github.com/python/typing/issues/1333).This solves https://github.com/danielfm/pybreaker/issues/84
Test Plan
python setup.py test
to ensure the tests still pass.python -m build
to build the package.py.typed
was included.... becomes "Any" due to an unfollowed import [error/no-any-unimported]
for imports frompybreaker
.