-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure type checks pass with mypy as well #536
Comments
I reviewed the mypy failures for the generated code and found that the warnings are specific to the customized portion of the generated code. For example, for Lines 273 to 288 in 8513f53
For another error Lines 108 to 122 in 8513f53
|
I'm not sure, but isn't the py.typed file missing in google/cloud/pubsub and google/cloud/pubsub_v1? |
FYI: If someone stumbles across this after struggling with mypy, you can just ignore it: from google.cloud import pubsub_v1 # type: ignore[attr-defined] |
encountering this with google-cloud-pubsub 2.18.4 -- apologies for the reopen if it's been resolved in a newer version. |
#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
, butmypy
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 addpy.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:
mypy
is added, and it runs on every PR.process: make sure type annoations pass with mypy #542
process: make sure type annoations pass with mypy #542
mypy
checks and produces no errors.BLOCKED by Generated code for Pub/Sub does not pass type checks with mypy gapic-generator-python#1092
mypy
and the check runs on every PR (process: add mypy session for samples #551).py.typed
file (requires all above items to be completed first)The text was updated successfully, but these errors were encountered: