Skip to content
Open
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
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
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