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

Create and install py.typed to advertise type annotations. #123

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

ydirson
Copy link
Contributor

@ydirson ydirson commented Jan 31, 2024

This patch is successful at adding py.typed to bdist and wheel outputs. (There seems to be something to be done at RPM level to get it really installed but that's a different story).

@ydirson ydirson marked this pull request as draft January 31, 2024 16:25
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (feeb478) 83.25% compared to head (00d5487) 83.25%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #123   +/-   ##
=======================================
  Coverage   83.25%   83.25%           
=======================================
  Files          22       22           
  Lines        3363     3363           
=======================================
  Hits         2800     2800           
  Misses        563      563           
Flag Coverage Δ
unittest 83.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ydirson
Copy link
Contributor Author

ydirson commented Jan 31, 2024

In the RPM packaging case, I suspected that the removal of setuptools_scm was to blame for the non-installed data file, so I also tried adding include xcp/py.typed to a MANIFEST.in, to no avail. Any idea appreciated. At least the standalone packaging does work.

Looks like python27.py would need some additional decls.

@ydirson ydirson marked this pull request as ready for review January 31, 2024 17:19
Copy link
Collaborator

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

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

@ydirson - Thank you, Yann!

For other reviewers: This adds an empty py.typed file which tells type checkers that this library has type annotations that they can use.

It only applies to type checkers and does not change regular run-time use in any way when type-checking is not used.

@bernhardkaindl bernhardkaindl merged commit 6a5589b into xenserver:master Mar 6, 2024
6 checks passed
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 this pull request may close these issues.

2 participants