pants
pants copied to clipboard
`pantsbuild.pants` missing top-level `__init__.py` causes type checkers to ignore the `py.typed` marker
Describe the bug
When importing anything from pantsbuild.pants
while using strict type checking, an error is reported claiming that the package is missing type stubs. The package is missing a top level __init__.py
file, causing type checkers to interpret each package inside pants build.pants
as wholly separate and requiring their own py.typed
files. This was confirmed with both MyPy and Pyright.
Pants version pantsbuild.pants==2.12.1rc2
It looks like we run afoul of the 3rd paragraph here since we do continue to need to ship pants
as a namespace package: https://peps.python.org/pep-0561/#packaging-type-information