Skip to content

fix: enable better type hint support for PEP 561 #812

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 2 commits into from
Jul 15, 2025

Conversation

sicoyle
Copy link
Contributor

@sicoyle sicoyle commented Jun 27, 2025

Description

This PR adds a py.typed marker file and updates setup.py to include it in package_data. This signals to type checkers that the package provides inline type annotations, following PEP 561. It improves type-checking support for users of the package.

For reference:
https://peps.python.org/pep-0561/#packaging-type-information
https://blog.whtsky.me/tech/2021/dont-forget-py.typed-for-your-typed-python-package/

Dapr Agents repo imports this as a dependency and bc this repo is missing the py.typed file, then all of my python sdk imports must have # type: ignore comment otherwise I get an error on the import using tox -e type cmd...

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Samantha Coyle <sam@diagrid.io>
@sicoyle sicoyle requested review from a team as code owners June 27, 2025 19:19
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.40%. Comparing base (bffb749) to head (6925311).
Report is 33 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #812      +/-   ##
==========================================
- Coverage   86.63%   86.40%   -0.23%     
==========================================
  Files          84       89       +5     
  Lines        4473     5106     +633     
==========================================
+ Hits         3875     4412     +537     
- Misses        598      694      +96     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sicoyle
Copy link
Contributor Author

sicoyle commented Jul 8, 2025

this PR is ready for merge pls. I added a file providing users with type safety who import this pkg, so there is no impact on code coverage

@elena-kolevska elena-kolevska merged commit 22ed7b3 into dapr:main Jul 15, 2025
14 of 15 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