-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore(generator): centralize mypy configuration and regenerate google-cloud-datastore POC #17408
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
base: main
Are you sure you want to change the base?
Changes from all commits
d728983
f1c0d41
779e62a
485e7db
9b403cb
cd574c9
8a618a5
5ae98b5
971e416
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| [mypy] | ||
| namespace_packages = True | ||
| ignore_missing_imports = False | ||
|
|
||
| # Helps mypy navigate the "google" namespace more reliably in 3.10+ | ||
| explicit_package_bases = True | ||
|
|
||
| # Performance: reuse results from previous runs to speed up "nox" | ||
| incremental = True | ||
|
|
||
| exclude = (?x)( | ||
| ^third_party/ | ||
| | tests/unit/resources/ | ||
| | tests/unit/gapic/ | ||
| ) | ||
|
|
||
| # TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): | ||
| # Dependencies that historically lacks py.typed markers | ||
| [mypy-google.iam.*] | ||
| ignore_missing_imports = True | ||
|
|
||
| [mypy-google.type.*] | ||
| ignore_missing_imports = True | ||
|
|
||
|
|
||
| # ============================================================================== | ||
| # PACKAGE-SPECIFIC OVERRIDES | ||
| # ============================================================================== | ||
|
|
||
| # --- google-cloud-core --- | ||
| [mypy-google.protobuf.*] | ||
| ignore_missing_imports = True | ||
|
|
||
| # --- bigframes --- | ||
| [mypy-cloudpickle.*] | ||
| ignore_missing_imports = True | ||
| [mypy-flask] | ||
| ignore_missing_imports = True | ||
| [mypy-pydata_google_auth] | ||
| ignore_missing_imports = True | ||
| [mypy-google.colab] | ||
| ignore_missing_imports = True | ||
| [mypy-pytz] | ||
| ignore_missing_imports = True | ||
| [mypy-pyarrow.*] | ||
| ignore_missing_imports = True | ||
| [mypy-ibis.*] | ||
| ignore_missing_imports = True | ||
| [mypy-ipywidgets] | ||
| ignore_missing_imports = True | ||
| [mypy-google.cloud.pubsub] | ||
| ignore_missing_imports = True | ||
| [mypy-google.cloud.bigtable] | ||
| ignore_missing_imports = True | ||
| [mypy-anywidget] | ||
| ignore_missing_imports = True | ||
|
|
||
| # --- google-cloud-bigtable --- | ||
| [mypy-google.cloud.bigtable.*] | ||
| check_untyped_defs = True | ||
| warn_unreachable = True | ||
| disallow_any_generics = True | ||
| ignore_errors = True | ||
|
|
||
| [mypy-google.cloud.bigtable.data.*] | ||
| ignore_errors = False | ||
|
Comment on lines
+59
to
+66
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting strictness flags like |
||
|
|
||
| [mypy-grpc.*] | ||
| ignore_missing_imports = True | ||
| [mypy-google.auth.*] | ||
| ignore_missing_imports = True | ||
| [mypy-google.longrunning.*] | ||
| ignore_missing_imports = True | ||
| [mypy-google.oauth2.*] | ||
| ignore_missing_imports = True | ||
| [mypy-google.rpc.*] | ||
| ignore_missing_imports = True | ||
| [mypy-proto.*] | ||
| ignore_missing_imports = True | ||
| [mypy-pytest] | ||
| ignore_missing_imports = True | ||
|
|
||
| # --- google-cloud-datastore --- | ||
| [mypy-google.cloud.datastore._app_engine_key_pb2] | ||
| ignore_errors = True | ||
|
|
||
| # TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): | ||
| # Remove once this generator bug is fixed | ||
| [mypy-google.cloud.datastore_v1.services.datastore.async_client] | ||
| ignore_errors = True | ||
|
|
||
| [mypy-google.cloud.datastore_v1.services.datastore.client] | ||
| ignore_errors = True | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
excludepattern uses^third_party/which only matches ifthird_party/is at the root of the search path. When runningmypyfrom individual package directories (e.g., vianox), or if a package has its own nestedthird_partydirectory, this anchor will prevent it from matching. Using(^|/)makes the exclusion patterns robust and consistent regardless of whethermypyis executed from the repository root or from a package subdirectory.