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

Ship py.typed file for mypy support #376

Open
adamtheturtle opened this issue Feb 2, 2024 · 0 comments · May be fixed by #383
Open

Ship py.typed file for mypy support #376

adamtheturtle opened this issue Feb 2, 2024 · 0 comments · May be fixed by #383
Labels
feature New feature or request

Comments

@adamtheturtle
Copy link

Is your feature request related to a problem? Please describe.

When I use mypy and piq, I get an error like the following:

mypy example.py
example.py:1: error: Skipping analyzing "piq": module is installed, but missing library stubs or py.typed marker  [import-untyped]
example.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

Even if I # type: ignore the error, I do not get the benefits of type safety when using piq.
Similar errors occur with other type checkers (pyre, pyright).

See https://peps.python.org/pep-0561/#packaging-type-information.

Describe the solution you'd like

Add an empty py.typed file to piq. This tells mypy to use the types defined in piq.

Describe alternatives you've considered

  • Use stubgen to create a types-piq package.
@adamtheturtle adamtheturtle added the feature New feature or request label Feb 2, 2024
@adamtheturtle adamtheturtle linked a pull request May 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant