diff --git a/mypy.ini b/mypy.ini index e36c23ebbc8a..05d59c9ea7b0 100644 --- a/mypy.ini +++ b/mypy.ini @@ -14,7 +14,6 @@ exclude = (?x)( | (^|/)tests/unit/gapic/ ) - # ============================================================================== # GLOBAL THIRD-PARTY & SHARED LIBRARY IGNORES # ============================================================================== @@ -28,13 +27,7 @@ ignore_missing_imports = True [mypy-flask] ignore_missing_imports = True -[mypy-google.auth.*] -ignore_missing_imports = True - -[mypy-google.cloud.bigtable] -ignore_missing_imports = True - -[mypy-google.cloud.pubsub] +[mypy-google.api.*] ignore_missing_imports = True [mypy-google.colab] @@ -61,6 +54,9 @@ ignore_missing_imports = True [mypy-grpc.*] ignore_missing_imports = True +[mypy-grpc_status] +ignore_missing_imports = True + [mypy-ibis.*] ignore_missing_imports = True @@ -86,8 +82,18 @@ ignore_missing_imports = True # ============================================================================== # PACKAGE-SPECIFIC OVERRIDES & EXCEPTIONS # ============================================================================== +# --- bigframes --- +[mypy-bigframes_vendored.*] +ignore_errors = True + +# --- google-auth --- +[mypy-google.auth.*] +ignore_missing_imports = True # --- google-cloud-bigtable --- +[mypy-google.cloud.bigtable] +ignore_missing_imports = True + [mypy-google.cloud.bigtable.*] ignore_errors = True @@ -97,4 +103,26 @@ warn_unreachable = True disallow_any_generics = True ignore_errors = False +[mypy-google.cloud.bigtable_admin.*] +ignore_errors = True + +[mypy-google.cloud.bigtable_admin_v2.*] +ignore_errors = True + +[mypy-google.cloud.bigtable_v2.*] +ignore_errors = True +# --- google-cloud-datastore --- +[mypy-google.cloud.datastore.*] +ignore_missing_imports = True + +[mypy-google.cloud.datastore._app_engine_key_pb2] +ignore_errors = True + +# --- google-cloud-firestore --- +[mypy-google.cloud.firestore.*] +check_untyped_defs = True + +# --- google-cloud-pubsub --- +[mypy-google.cloud.pubsub] +ignore_missing_imports = True diff --git a/packages/google-cloud-bigquery/mypy.ini b/packages/google-cloud-bigquery/mypy.ini deleted file mode 100644 index a3cb5c292172..000000000000 --- a/packages/google-cloud-bigquery/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.14 -namespace_packages = True diff --git a/packages/google-cloud-bigquery/noxfile.py b/packages/google-cloud-bigquery/noxfile.py index c1dd1692b744..d4accfea91a4 100644 --- a/packages/google-cloud-bigquery/noxfile.py +++ b/packages/google-cloud-bigquery/noxfile.py @@ -41,6 +41,17 @@ ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"] UNIT_TEST_PYTHON_VERSIONS = ALL_PYTHON CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() +# Path to the centralized mypy configuration file at the repository root. +# Search upwards to support running nox from both monorepo packages and integration test goldens. +MYPY_CONFIG_FILE = next( + ( + str(p / "mypy.ini") + for p in CURRENT_DIRECTORY.parents + if (p / "mypy.ini").exists() + ), + str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"), +) + SYSTEM_TEST_PYTHON_VERSIONS = UNIT_TEST_PYTHON_VERSIONS @@ -215,7 +226,13 @@ def mypy(session): ) session.run("python", "-m", "pip", "freeze") with log_package_context(session): - session.run("mypy", "-p", "google", "--show-traceback") + session.run( + "mypy", + f"--config-file={MYPY_CONFIG_FILE}", + "-p", + "google", + "--show-traceback", + ) @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)