Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ exclude = (?x)(
| (^|/)tests/unit/gapic/
)


# ==============================================================================
# GLOBAL THIRD-PARTY & SHARED LIBRARY IGNORES
# ==============================================================================
Expand All @@ -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]
Expand All @@ -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

Expand All @@ -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

Expand All @@ -97,4 +103,26 @@ warn_unreachable = True
disallow_any_generics = True
ignore_errors = False
Comment thread
chalmerlowe marked this conversation as resolved.

[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
3 changes: 0 additions & 3 deletions packages/google-cloud-bigquery/mypy.ini

This file was deleted.

19 changes: 18 additions & 1 deletion packages/google-cloud-bigquery/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
Loading