python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

fix: enable better type hint support for PEP 561

Open sicoyle opened this issue 6 months ago • 1 comments

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

sicoyle avatar Jun 27 '25 19:06 sicoyle

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 27 '25 19:06 codecov[bot]

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

sicoyle avatar Jul 08 '25 14:07 sicoyle