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

Feature: Add a py.typed file to support type checking in downstream code #312

Open
cebtenzzre opened this issue Jul 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@cebtenzzre
Copy link
Member

We use plenty of type annotations in this repo. If we add a py.typed file, downstream use of functions and classes imported from nomic can be type-checked.

This should only be done if the type annotations are relatively complete, though - if they are too permissive, this could let strict type checks pass on incorrect downstream code.

I'm not sure if it'll be a problem that mypy doesn't pass on this repo, since downstream projects may use mypy. pyi stubs generated with e.g. stubgen could be one way around that.

See also (Python/mypy): https://typing.readthedocs.io/en/latest/spec/distributing.html#packaging-type-information
See also (pyright): https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface

@cebtenzzre cebtenzzre added the enhancement New feature or request label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant