Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit 07ea9ab

Browse files
chore(python): remove noxfile.py from templates
Source-Link: googleapis/synthtool@7765802 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:25de45b58e52021d3a24a6273964371a97a4efeefe6ad3845a64e697c63b6447
1 parent be90054 commit 07ea9ab

2 files changed

Lines changed: 81 additions & 3 deletions

File tree

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:5581906b957284864632cde4e9c51d1cc66b0094990b27e689132fe5cd036046
17-
# created: 2025-03-05
16+
digest: sha256:25de45b58e52021d3a24a6273964371a97a4efeefe6ad3845a64e697c63b6447
17+
# created: 2025-04-14T14:34:43.260858345Z

noxfile.py

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
MYPY_VERSION = "mypy==1.10.0"
3636

37+
MYPY_VERSION = "mypy==1.10.0"
38+
3739
DEFAULT_PYTHON_VERSION = "3.8"
3840

3941
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
@@ -87,6 +89,11 @@
8789
"mypy",
8890
# https://github.com/googleapis/python-pubsub/pull/552#issuecomment-1016256936
8991
# "mypy_samples", # TODO: uncomment when the check passes
92+
"mypy",
93+
# https://github.com/googleapis/python-pubsub/pull/552#issuecomment-1016256936
94+
# "mypy_samples", # TODO: uncomment when the check passes
95+
# https://github.com/googleapis/python-pubsub/pull/552#issuecomment-1016256936
96+
# "mypy_samples", # TODO: uncomment when the check passes
9097
"docs",
9198
"docfx",
9299
"format",
@@ -143,6 +150,77 @@ def mypy_samples(session):
143150
)
144151

145152

153+
@nox.session(python=DEFAULT_PYTHON_VERSION)
154+
def mypy(session):
155+
"""Run type checks with mypy."""
156+
session.install("-e", ".[all]")
157+
session.install(MYPY_VERSION)
158+
159+
# Version 2.1.1 of google-api-core version is the first type-checked release.
160+
# Version 2.2.0 of google-cloud-core version is the first type-checked release.
161+
session.install(
162+
"google-api-core[grpc]>=2.1.1",
163+
"google-cloud-core>=2.2.0",
164+
)
165+
166+
# Just install the type info directly, since "mypy --install-types" might
167+
# require an additional pass.
168+
# Exclude types-protobuf==4.24.0.20240106
169+
# See https://github.com/python/typeshed/issues/11254
170+
session.install("types-protobuf!=4.24.0.20240106", "types-setuptools")
171+
172+
# TODO: Only check the hand-written layer, the generated code does not pass
173+
# mypy checks yet.
174+
# https://github.com/googleapis/gapic-generator-python/issues/1092
175+
session.run("mypy", "-p", "google.cloud")
176+
177+
178+
@nox.session(python=DEFAULT_PYTHON_VERSION)
179+
def mypy_samples(session):
180+
"""Run type checks with mypy."""
181+
182+
session.install("-e", ".[all]")
183+
184+
session.install("pytest")
185+
session.install(MYPY_VERSION)
186+
187+
# Just install the type info directly, since "mypy --install-types" might
188+
# require an additional pass.
189+
session.install("types-mock", "types-protobuf", "types-setuptools")
190+
191+
session.run(
192+
"mypy",
193+
"--config-file",
194+
str(CURRENT_DIRECTORY / "samples" / "snippets" / "mypy.ini"),
195+
"--no-incremental", # Required by warn-unused-configs from mypy.ini to work
196+
"samples/",
197+
)
198+
199+
200+
@nox.session(python=DEFAULT_PYTHON_VERSION)
201+
def mypy_samples(session):
202+
"""Run type checks with mypy."""
203+
204+
session.install("-e", ".[all]")
205+
206+
session.install("pytest")
207+
session.install(MYPY_VERSION)
208+
209+
# Just install the type info directly, since "mypy --install-types" might
210+
# require an additional pass.
211+
session.install("types-mock", "types-protobuf", "types-setuptools")
212+
213+
session.run(
214+
"mypy",
215+
# https://github.com/googleapis/python-pubsub/pull/552#issuecomment-1016256936
216+
# "mypy_samples", # TODO: uncomment when the check passes
217+
"--config-file",
218+
str(CURRENT_DIRECTORY / "samples" / "snippets" / "mypy.ini"),
219+
"--no-incremental", # Required by warn-unused-configs from mypy.ini to work
220+
"samples/",
221+
)
222+
223+
146224
@nox.session(python=DEFAULT_PYTHON_VERSION)
147225
def lint(session):
148226
"""Run linters.
@@ -251,7 +329,7 @@ def unit(session, protobuf_implementation):
251329
"py.test",
252330
"--quiet",
253331
f"--junitxml=unit_{session.python}_sponge_log.xml",
254-
"--cov=google/cloud",
332+
"--cov=google/cloud/cloud",
255333
"--cov=tests/unit",
256334
"--cov-append",
257335
"--cov-config=.coveragerc",

0 commit comments

Comments
 (0)