-
Notifications
You must be signed in to change notification settings - Fork 215
Open
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.
Description
#500 added type annotation to the codebase, but we only checked that static type analysis passes under pytype. A lot of people, on the other hand, use mypy, but mypy currently reports 97 errors.
If we want users to leverage our type annotations, we should make sure that the checks pass with mypy as well, and then we can also add py.typed file to declare the library type-checked.
An additional requirement of this issue is that a new nox session named mypy needs to be added and enabled by default.
Acceptance criteria:
- A new nox session named
mypyis added, and it runs on every PR.
process: make sure type annoations pass with mypy #542 - The hand-written layer passes type checks.
process: make sure type annoations pass with mypy #542 - The autogenerated part of the library is included in
mypychecks and produces no errors.
BLOCKED by Generated code for Pub/Sub does not pass type checks with mypy gapic-generator-python#1092 - Code samples are checked with
mypyand the check runs on every PR (process: add mypy session for samples #551).- Refactor the manual client to inherit from the generated class instead of dynamically injecting the latter's methods. Mypy otherwise cannot know about the dynamically added methods.
- The library declares itself as type-checked by adding a marker
py.typedfile (requires all above items to be completed first)
galah92, pp-gborodin, MartinDevi, sammaxwellxyz and sh-at-cs
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.