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

chore(refactor): add a py.typed file #91

Merged
merged 1 commit into from
May 14, 2024

Conversation

jameslamb
Copy link
Member

Contributes to #76 and #87.

Proposes adding a py.typed file, to advertise to type-checkers that this project contains inline type hints (i.e. doesn't ship a separate package of type stubs).

This is described in PEP 561: https://peps.python.org/pep-0561/

Package maintainers who wish to support type checking of their code MUST add a marker file named py.typed to their package supporting typing.

This didn't really matter when rapids-dependency-file-generator was only being used as a CLI, but now that rapids-build-backend is consuming it as a library, I think this is useful to have. It means that mypy, pyright, etc. used to check rapids-build-backend will also consider rapids_dependency_file_generator's type hints.

How I tested this

Built a wheel and confirmed that this file made it in with my MANIFEST.in changes here.

python -m build .
unzip -l ./dist/rapids_dependency_file_generator-1.13.5-py3-none-any.whl

@jameslamb jameslamb added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels May 13, 2024
@jameslamb jameslamb changed the title add a py.typed file chore(refactor): add a py.typed file May 13, 2024
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add mypy to the pre-commit hooks? I glanced over PEP 561, thanks for the context since this is unfamiliar to me.

@jameslamb
Copy link
Member Author

Do we need to add mypy to the pre-commit hooks?

I think we should, but it'll take a bit of work to get there. I documented that in #87 and am gonna keep chipping away it this week while waiting on builds for other projects.

@jameslamb jameslamb merged commit a8660f4 into rapidsai:main May 14, 2024
5 checks passed
@jameslamb jameslamb deleted the mypy/py-typed branch May 14, 2024 14:05
@GPUtester
Copy link

🎉 This PR is included in version 1.13.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants