Skip to content

Commit a734cfc

Browse files
authored
Revert "chore(generator): centralize mypy configuration and regenerate google-cloud-datastore POC" (#17493)
Reverts #17408
1 parent 27d999d commit a734cfc

30 files changed

Lines changed: 215 additions & 167 deletions

File tree

.librarian/generator-input/client-post-processing/datastore-integration.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,42 @@ replacements:
3939
"google-cloud-core >= 2.0.0, <3.0.0",
4040
"grpcio >= 1.59.0, < 2.0.0",
4141
count: 1
42+
- paths: [
43+
"packages/google-cloud-datastore/mypy.ini",
44+
]
45+
before: |-
46+
# Performance: reuse results from previous runs to speed up 'nox'
47+
incremental = True
48+
after: |-
49+
# Performance: reuse results from previous runs to speed up "nox"
50+
incremental = True
51+
52+
[mypy-google.cloud.datastore._app_engine_key_pb2]
53+
ignore_errors = True
54+
55+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410):
56+
# Remove once this generator bug is fixed
57+
[mypy-google.cloud.datastore_v1.services.datastore.async_client]
58+
ignore_errors = True
59+
60+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410):
61+
# Remove once this generator bug is fixed
62+
[mypy-google.cloud.datastore_v1.services.datastore.client]
63+
ignore_errors = True
64+
count: 1
65+
- paths: [
66+
"packages/google-cloud-datastore/mypy.ini",
67+
]
68+
before: |
69+
ignore_missing_imports = False
70+
71+
# TODO\(https://github.com/googleapis/gapic-generator-python/issues/2563\):
72+
# Dependencies that historically lacks py.typed markers
73+
\[mypy-google\.iam\.\*\]
74+
ignore_missing_imports = True
75+
after: |
76+
ignore_missing_imports = True
77+
count: 1
4278
- paths: [
4379
"packages/google-cloud-datastore/docs/index.rst",
4480
]

mypy.ini

Lines changed: 0 additions & 110 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[mypy]
2+
python_version = 3.10
3+
namespace_packages = True

packages/gapic-generator/gapic/ads-templates/noxfile.py.j2

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
{% block content %}
44

55
import os
6-
import pathlib
76

87
import nox # type: ignore
98

109

11-
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
12-
# Path to the centralized mypy configuration file at the repository root.
13-
MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
14-
15-
1610
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
1711
# Add tests for Python 3.15 alpha1
1812
# https://peps.python.org/pep-0790/
@@ -50,7 +44,6 @@ def mypy(session):
5044
session.install('.')
5145
session.run(
5246
'mypy',
53-
f"--config-file={MYPY_CONFIG_FILE}",
5447
{% if api.naming.module_namespace %}
5548
'{{ api.naming.module_namespace[0] }}',
5649
{% else %}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[mypy]
2+
python_version = 3.14
3+
namespace_packages = True
4+
ignore_missing_imports = False
5+
6+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563):
7+
# Dependencies that historically lacks py.typed markers
8+
[mypy-google.iam.*]
9+
ignore_missing_imports = True
10+
11+
# Helps mypy navigate the 'google' namespace more reliably in 3.10+
12+
explicit_package_bases = True
13+
14+
# Performance: reuse results from previous runs to speed up 'nox'
15+
incremental = True

packages/gapic-generator/gapic/templates/noxfile.py.j2

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ DEFAULT_PYTHON_VERSION = "3.14"
4040
PREVIEW_PYTHON_VERSION = "3.14"
4141

4242
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
43-
# Path to the centralized mypy configuration file at the repository root.
44-
MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
4543

4644
if (CURRENT_DIRECTORY / "testing").exists():
4745
LOWER_BOUND_CONSTRAINTS_FILE = (
@@ -103,7 +101,6 @@ def mypy(session):
103101
session.install(".")
104102
session.run(
105103
"mypy",
106-
f"--config-file={MYPY_CONFIG_FILE}",
107104
"-p",
108105
{% if api.naming.module_namespace %}
109106
"{{ api.naming.module_namespace[0] }}",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[mypy]
2+
python_version = 3.14
3+
namespace_packages = True
4+
ignore_missing_imports = False
5+
6+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563):
7+
# Dependencies that historically lacks py.typed markers
8+
[mypy-google.iam.*]
9+
ignore_missing_imports = True
10+
11+
# Helps mypy navigate the 'google' namespace more reliably in 3.10+
12+
explicit_package_bases = True
13+
14+
# Performance: reuse results from previous runs to speed up 'nox'
15+
incremental = True

packages/gapic-generator/tests/integration/goldens/asset/noxfile.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
PREVIEW_PYTHON_VERSION = "3.14"
4848

4949
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
50-
# Path to the centralized mypy configuration file at the repository root.
51-
MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
5250

5351
if (CURRENT_DIRECTORY / "testing").exists():
5452
LOWER_BOUND_CONSTRAINTS_FILE = (
@@ -110,7 +108,6 @@ def mypy(session):
110108
session.install(".")
111109
session.run(
112110
"mypy",
113-
f"--config-file={MYPY_CONFIG_FILE}",
114111
"-p",
115112
"google",
116113
"--check-untyped-defs",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[mypy]
2+
python_version = 3.14
3+
namespace_packages = True
4+
ignore_missing_imports = False
5+
6+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563):
7+
# Dependencies that historically lacks py.typed markers
8+
[mypy-google.iam.*]
9+
ignore_missing_imports = True
10+
11+
# Helps mypy navigate the 'google' namespace more reliably in 3.10+
12+
explicit_package_bases = True
13+
14+
# Performance: reuse results from previous runs to speed up 'nox'
15+
incremental = True

packages/gapic-generator/tests/integration/goldens/credentials/noxfile.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
PREVIEW_PYTHON_VERSION = "3.14"
4848

4949
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
50-
# Path to the centralized mypy configuration file at the repository root.
51-
MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
5250

5351
if (CURRENT_DIRECTORY / "testing").exists():
5452
LOWER_BOUND_CONSTRAINTS_FILE = (
@@ -110,7 +108,6 @@ def mypy(session):
110108
session.install(".")
111109
session.run(
112110
"mypy",
113-
f"--config-file={MYPY_CONFIG_FILE}",
114111
"-p",
115112
"google",
116113
"--check-untyped-defs",

0 commit comments

Comments
 (0)