Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pantsbuild.pants missing top-level __init__.py causes type checkers to ignore the py.typed marker #16359

Open
relsunkaev opened this issue Jul 31, 2022 · 1 comment
Labels

Comments

@relsunkaev
Copy link

relsunkaev commented Jul 31, 2022

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

@relsunkaev relsunkaev added the bug label Jul 31, 2022
@relsunkaev relsunkaev changed the title Pants package missing top-level __init__.py causing type checkers to ignore the py.typed file on strict pantsbuild.pants missing top-level __init__.py causes type checkers to ignore the py.typed marker Jul 31, 2022
@jsirois
Copy link
Contributor

jsirois commented Jul 31, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants