Skip to content

Add py.typed to export types #21

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

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Add py.typed to export types #21

merged 1 commit into from
Apr 26, 2023

Conversation

unflxw
Copy link
Contributor

@unflxw unflxw commented Apr 26, 2023

Turns out the typechecker will ignore the type hints declared in dependencies unless those dependencies contain an empty py.typed file. So users who use our library will not be able to make use of our type hints unless we add this file.

See this article and PEP 561 for more information.

[skip changeset]

Turns out the typechecker will ignore the type hints declared in
dependencies unless those dependencies contain an empty `py.typed`
file.

See [this article][article] and [PEP 561][pepsi] for more
information.

[article]: https://blog.whtsky.me/tech/2021/dont-forget-py.typed-for-your-typed-python-package/
[pepsi]: https://peps.python.org/pep-0561/#packaging-type-information
@unflxw unflxw added the chore label Apr 26, 2023
@unflxw unflxw self-assigned this Apr 26, 2023
@backlog-helper
Copy link

backlog-helper bot commented Apr 26, 2023

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

@unflxw unflxw requested review from luismiramirez and removed request for thijsc April 26, 2023 11:10
@unflxw
Copy link
Contributor Author

unflxw commented Apr 26, 2023

Now that I think about it, I think this might actually break things for users that make use of typing, since we use incomplete features that need to be enabled in mypy's command line for what's pretty much the only public interface at the moment 🙃

Maybe let's enable it anyway and see if it's actually a problem in practice?

EDIT: according to this issue comment it wouldn't be a problem at call point, just at the declaration point -- not sure if it means users wouldn't be affected.

@unflxw unflxw force-pushed the add-py-typed-file branch from 10616f1 to a635171 Compare April 26, 2023 14:34
@unflxw
Copy link
Contributor Author

unflxw commented Apr 26, 2023

Merging -- we can always revisit later. Test failure is Lintje because I rebased out a commit from the branch.

@unflxw unflxw merged commit ef5ab04 into main Apr 26, 2023
@tombruijn tombruijn deleted the add-py-typed-file branch April 26, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants