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

Missing py.typed to indicate native typing support #66

Closed
bartelemi opened this issue Feb 27, 2024 · 4 comments · Fixed by #71
Closed

Missing py.typed to indicate native typing support #66

bartelemi opened this issue Feb 27, 2024 · 4 comments · Fixed by #71

Comments

@bartelemi
Copy link

what.

Since you're declaring types in your codebase, you should add the py.typed file to the repository (under the alembic_postgresql_enum directory) and include it in the distributed package.

This is so that people don't have to add your library to mypy ignore list :)

references.

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

@RustyGuard
Copy link
Member

Thank you for suggestion however I do not think it is necessary. Our library is only imported in env.py file which is rarely checked by mypy (correct me if I am wrong)

@bfontaine
Copy link

Our library is only imported in env.py file which is rarely checked by mypy (correct me if I am wrong)

Well, mypy checks whatever you ask it to check. I prefer to check everything I can, and without this py.typed I get a warning on this library. It’s not super important, but if you could add it in the next release it would be nice :)

@bartelemi
Copy link
Author

Our library is only imported in env.py file which is rarely checked by mypy (correct me if I am wrong)

Well, mypy checks whatever you ask it to check. I prefer to check everything I can, and without this py.typed I get a warning on this library. It’s not super important, but if you could add it in the next release it would be nice :)

Pretty much this ☝🏻 Without the py.typed file (which is just an empty file in your repo, an indicator), I have to explicitly add this library in the mypy exclude list. It looks like you already add type definitions to your lib, so the only thing to worry about is adding this file and making sure it is shipped in the final package.

image

@RustyGuard RustyGuard linked a pull request Mar 31, 2024 that will close this issue
@RustyGuard RustyGuard reopened this Mar 31, 2024
@RustyGuard
Copy link
Member

These changes are shipped in 1.2.0a1 version. I'll close this issue when next release will be dropped

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

Successfully merging a pull request may close this issue.

3 participants