Skip to content
22 changes: 13 additions & 9 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ ignore_missing_imports = True
[mypy-flask]
ignore_missing_imports = True

[mypy-google.api.*]
[mypy-google.api,google.api.*]
ignore_missing_imports = True

[mypy-google.colab]
ignore_missing_imports = True

[mypy-google.iam.*]
[mypy-google.iam,google.iam.*]
ignore_missing_imports = True

[mypy-google.longrunning.*]
[mypy-google.longrunning,google.longrunning.*]
ignore_missing_imports = True

[mypy-google.oauth2.*]
[mypy-google.oauth2,google.oauth2.*]
ignore_missing_imports = True

[mypy-google.protobuf.*]
[mypy-google.protobuf,google.protobuf.*]
ignore_missing_imports = True

[mypy-google.rpc.*]
[mypy-google.rpc,google.rpc.*]
ignore_missing_imports = True

[mypy-google.type.*]
[mypy-google.type,google.type.*]
ignore_missing_imports = True

[mypy-grpc.*]
[mypy-grpc,grpc.*]
ignore_missing_imports = True

[mypy-grpc_status]
Expand All @@ -63,7 +63,7 @@ ignore_missing_imports = True
[mypy-ipywidgets]
ignore_missing_imports = True

[mypy-proto.*]
[mypy-proto,proto.*]
ignore_missing_imports = True

[mypy-pyarrow.*]
Expand Down Expand Up @@ -95,14 +95,18 @@ ignore_missing_imports = True
ignore_missing_imports = True

[mypy-google.cloud.bigtable.*]
# Broadly ignore errors for the older, legacy/handwritten parts of the library
ignore_errors = True

[mypy-google.cloud.bigtable.data.*]
# Enable strict checks ONLY for the modern data submodule
check_untyped_defs = True
warn_unreachable = True
disallow_any_generics = True
# Do NOT ignore errors in the modern submodule
ignore_errors = False


[mypy-google.cloud.bigtable_admin.*]
ignore_errors = True

Expand Down
15 changes: 0 additions & 15 deletions packages/google-cloud-spanner/mypy.ini

This file was deleted.

12 changes: 12 additions & 0 deletions packages/google-cloud-spanner/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

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"),
)


nox.options.sessions = [
"unit-3.10",
Expand Down Expand Up @@ -767,6 +778,7 @@ def mypy(session):
session.install(".")
session.run(
"mypy",
f"--config-file={MYPY_CONFIG_FILE}",
"-p",
"google",
# "--check-untyped-defs",
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-spanner/tests/system/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import uuid

from google.api_core import exceptions
from google.cloud.spanner_v1 import instance as instance_mod
from test_utils import retry

from google.cloud.spanner_v1 import instance as instance_mod
from tests import _fixtures

CREATE_INSTANCE_ENVVAR = "GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE"
Expand Down
1 change: 0 additions & 1 deletion packages/google-cloud-spanner/tests/system/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import time

import pytest

from google.cloud import spanner_v1
from google.cloud.spanner_admin_database_v1 import DatabaseDialect
from google.cloud.spanner_admin_database_v1.types.backup import (
Expand Down
Loading