-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Make sure type checks pass with mypy as well #15652
Copy link
Copy link
Open
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub 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.
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub 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.
googleapis/python-pubsub#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, usemypy, butmypycurrently reports 97 errors.If we want users to leverage our type annotations, we should make sure that the checks pass with
mypyas well, and then we can also addpy.typedfile to declare the library type-checked.An additional requirement of this issue is that a new nox session named
mypyneeds to be added and enabled by default.Acceptance criteria:
mypyis added, and it runs on every PR.process: make sure type annoations pass with mypy python-pubsub#542
process: make sure type annoations pass with mypy python-pubsub#542
mypychecks and produces no errors.BLOCKED by Generated code for Pub/Sub does not pass type checks with mypy gapic-generator-python#1092
mypyand the check runs on every PR (process: add mypy session for samples python-pubsub#551).py.typedfile (requires all above items to be completed first)