-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Jira: https://asfdaac.atlassian.net/browse/TOOL-3457
Note: The above link is accessible only to members of ASF.
Although we have added our mypy workflow to all of our Python repos, including our distributed packages such as the hyp3-sdk (see our Releasing HyP3 SDK and other packages wiki article for a complete list), we haven't yet enabled library type support for our distributed packages, so if someone imports one of our modules in their code (e.g. from hyp3_sdk import HyP3
), they'll get a missing library stubs or py.typed marker
error and the imported module will default to type Any
(dynamic typing).
From Creating PEP 561 compatible packages, I think enabling static type checking for our published libraries is just:
- Ensure that all public functions and classes within the package module have type annotations.
- Add a
py.typed
file to the package directory.
Also see https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker