Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
bedd2f2
feat(handwritten): centralize mypy.ini and update noxfiles
chalmerlowe Jun 9, 2026
d449d71
style(mypy): format modified noxfile.py files with black
chalmerlowe Jun 9, 2026
15b1b64
fix(handwritten): use dynamic parent-directory traversal for mypy.ini…
chalmerlowe Jun 23, 2026
9defb81
style(handwritten): format modified noxfiles according to style guide
chalmerlowe Jun 23, 2026
b1456a6
chore: restore mypy.ini and noxfile.py for google-crc32c
chalmerlowe Jun 25, 2026
234bd93
chore: removes blank spaces from file
chalmerlowe Jun 30, 2026
b520bb7
chore: restores bigframes files due to system test issues
chalmerlowe Jun 30, 2026
bda8f95
chore: restores bigframes files due to system test issues
chalmerlowe Jun 30, 2026
5fada6e
chore: revert changes for overreaching generated packages
chalmerlowe Jun 30, 2026
2f63dcc
feat(handwritten): centralize mypy config for hybrid packages and add…
chalmerlowe Jun 30, 2026
5db0eda
chore: remove scratch files from PR
chalmerlowe Jun 30, 2026
24c40b4
feat(handwritten): centralize mypy config for all handwritten packages
chalmerlowe Jun 30, 2026
8992e36
updates to mypy.ini re: bigtable
chalmerlowe Jul 1, 2026
1fba466
updates mypy.ini to account for several package specific settings.
chalmerlowe Jul 1, 2026
81c42bf
fix: resolve syntax errors in noxfiles due to escaped quotes
chalmerlowe Jul 1, 2026
ce4bc47
fix(mypy): add global ignores for grpc_status and google.api
chalmerlowe Jul 1, 2026
4def939
fix(mypy): restore ignores for generated bigtable packages
chalmerlowe Jul 1, 2026
5a22944
chore(tests): apply blacken/ruff formatting to modified noxfiles
chalmerlowe Jul 1, 2026
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
50 changes: 39 additions & 11 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,15 +82,47 @@ 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_errors = True
[mypy-google.cloud.bigtable]
ignore_missing_imports = True

[mypy-google.cloud.bigtable.data.*]
[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

[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/bigquery-magics/mypy.ini

This file was deleted.

11 changes: 11 additions & 0 deletions packages/bigquery-magics/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@
}

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",
Expand Down
12 changes: 12 additions & 0 deletions packages/db-dtypes/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,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"),
)


# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
Expand Down Expand Up @@ -541,6 +552,7 @@ def mypy(session):
session.install("-e", ".")
session.run(
"mypy",
f"--config-file={MYPY_CONFIG_FILE}",
"-p",
"db_dtypes",
"--check-untyped-defs",
Expand Down
10 changes: 10 additions & 0 deletions packages/django-google-spanner/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@
]

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.session(python=DEFAULT_PYTHON_VERSION)
Expand Down
2 changes: 0 additions & 2 deletions packages/gapic-generator/mypy.ini

This file was deleted.

34 changes: 26 additions & 8 deletions packages/gapic-generator/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@

showcase_version = os.environ.get("SHOWCASE_VERSION", "0.35.0")
ADS_TEMPLATES = path.join(path.dirname(__file__), "gapic", "ads-templates")
CURRENT_DIRECTORY = 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"),
)

RUFF_VERSION = "ruff==0.14.14"
LINT_PATHS = ["docs", "gapic", "tests", "test_utils", "noxfile.py", "setup.py"]
# Ruff uses globs for excludes (different from Black's regex)
Expand Down Expand Up @@ -714,7 +726,7 @@ def mypy(session):
"click==8.1.3",
)
session.install(".")
session.run("mypy", "-p", "gapic")
session.run("mypy", f"--config-file={MYPY_CONFIG_FILE}", "-p", "gapic")


@nox.session(python=NEWEST_PYTHON)
Expand All @@ -726,7 +738,7 @@ def lint(session):
"""

# TODO(https://github.com/googleapis/google-cloud-python/issues/16186):
# SKIP: This session was not enforced in the standalone (split) repo
# SKIP: This session was not enforced in the standalone (split) repo

@chalmerlowe chalmerlowe Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment for reviewer:
The next few edits are the linter doing linting as opposed to new code.

  • Removing spaces
  • Splitting long parens across multiple lines

# and is disabled here to ensure a "move-only" migration.
session.skip(
"Linting was not enforced in the split repo. "
Expand Down Expand Up @@ -756,9 +768,11 @@ def lint(session):
@nox.session(python=NEWEST_PYTHON)
def lint_setup_py(session):
# TODO(https://github.com/googleapis/google-cloud-python/issues/16186):
# SKIP: This session was not enforced in the standalone (split) repo
# SKIP: This session was not enforced in the standalone (split) repo
# and is disabled here to ensure a "move-only" migration.
session.skip("Skipping now to avoid changing code during migration. See Issue #16186")
session.skip(
"Skipping now to avoid changing code during migration. See Issue #16186"
)


@nox.session(python="3.10")
Expand Down Expand Up @@ -833,9 +847,11 @@ def prerelease_deps(session, protobuf_implementation):
"""
Run all tests with pre-release versions of dependencies installed.
"""
# TODO(https://github.com/googleapis/google-cloud-python/issues/16184):
# TODO(https://github.com/googleapis/google-cloud-python/issues/16184):
# Implement pre-release dependency logic to test against upcoming runtime changes.
session.skip("prerelease_deps session is not yet implemented for gapic-generator-python.")
session.skip(
"prerelease_deps session is not yet implemented for gapic-generator-python."
)


@nox.session(python=NEWEST_PYTHON)
Expand All @@ -845,6 +861,8 @@ def prerelease_deps(session, protobuf_implementation):
)
def core_deps_from_source(session, protobuf_implementation):
"""Run all tests with core dependencies installed from source."""
# TODO(https://github.com/googleapis/google-cloud-python/issues/16185):
# TODO(https://github.com/googleapis/google-cloud-python/issues/16185):
# Implement logic to install core packages directly from the mono-repo directories.
session.skip("core_deps_from_source session is not yet implemented for gapic-generator-python.")
session.skip(
"core_deps_from_source session is not yet implemented for gapic-generator-python."
)
13 changes: 13 additions & 0 deletions packages/gcp-sphinx-docfx-yaml/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@
# limitations under the License.

import os
import pathlib

import nox

DEFAULT_PYTHON_VERSION = "3.14"
UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
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"),
)

RUFF_VERSION = "ruff==0.14.14"

ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
Expand Down
12 changes: 11 additions & 1 deletion packages/google-api-core/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@

DEFAULT_PYTHON_VERSION = "3.14"
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"),
)


# Error if a python version is missing
Expand Down Expand Up @@ -370,7 +380,7 @@ def mypy(session):
"types-requests",
"types-protobuf",
)
session.run("mypy", "google", "tests")
session.run("mypy", f"--config-file={MYPY_CONFIG_FILE}", "google", "tests")


@nox.session(python=DEFAULT_PYTHON_VERSION)
Expand Down
12 changes: 12 additions & 0 deletions packages/google-auth-httplib2/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"),
)


# Error if a python version is missing
nox.options.error_on_missing_interpreters = True
Expand Down Expand Up @@ -101,6 +112,7 @@ def mypy(session):
session.install(".")
session.run(
"mypy",
f"--config-file={MYPY_CONFIG_FILE}",
"google_auth_httplib2.py",
)

Expand Down
12 changes: 12 additions & 0 deletions packages/google-auth-oauthlib/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"),
)


# Error if a python version is missing
nox.options.error_on_missing_interpreters = True
Expand Down Expand Up @@ -471,6 +482,7 @@ def mypy(session):
session.install(".")
session.run(
"mypy",
f"--config-file={MYPY_CONFIG_FILE}",
"-p",
"google_auth_oauthlib",
)
3 changes: 0 additions & 3 deletions packages/google-auth/mypy.ini

This file was deleted.

22 changes: 21 additions & 1 deletion packages/google-auth/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
import nox

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


CLICK_VERSION = "click"
BLACK_VERSION = "black==23.7.0"
Expand Down Expand Up @@ -156,7 +167,16 @@ def mypy(session):
"types-mock",
"pytest<8.0.0",
)
session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async")
session.run(
"mypy",
f"--config-file={MYPY_CONFIG_FILE}",
"-p",
"google",
"-p",
"tests",
"-p",
"tests_async",
)


@nox.session(python=ALL_PYTHON)
Expand Down
3 changes: 0 additions & 3 deletions packages/google-cloud-bigquery/mypy.ini

This file was deleted.

Loading
Loading