Conversation
|
Hello @ShyamD2 , Thanks for your contribution. As you point out, the ESDK for Python does not currently comply with PEP 561 or support Mypy in any meaningful way. However, we do not have any immediate plans to add new type hints, so it doesn't make sense to add these files to advertise typing information which is not actually present. If you want to avoid the error, you can add this to your local configuration: Alternatively, you propose in #563 to add .pyi stubs for the primary public API. This would be a more reasonable change. If you'd prefer this approach, please add .pyi stub files accordingly. |
|
Hello @kessplas, Thanks for the feedback and guidance! That makes total sense—advertising typing via py.typed without actual type definitions doesn't provide real type safety downstream. Per your suggestion, I have updated this PR with .pyi stub files covering the primary public API: aws_encryption_sdk/init.pyi: Type definitions for EncryptionSDKClient, EncryptionSDKClientConfig, methods (encrypt, decrypt, and @overload definitions for stream), along with top-level re-exports. |
Issue #, if available:
Fixes #563
Description of changes:
Adds PEP 561 compliance so downstream projects using
mypycan analyzeaws_encryption_sdkwithout receivingerror: Skipping analyzing "aws_encryption_sdk": module is installed, but missing library stubs or py.typed marker.Summary of Changes:
src/aws_encryption_sdk/py.typedcontaining thepartialmarker per PEP 561.setup.pyto includepackage_data={"aws_encryption_sdk": ["py.typed"]}so wheel packages bundle the marker.MANIFEST.inwithinclude src/aws_encryption_sdk/py.typedfor source distribution packaging.Verification:
Tested with
mypyanalyzing public client initialization: