Skip to content

Commit ed3c79d

Browse files
1 parent 1adcb4a commit ed3c79d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎noxfile.py‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@
7979
"system",
8080
"mypy",
8181
"mypy",
82+
"mypy",
8283
"cover",
8384
"lint",
8485
"lint_setup_py",
8586
"blacken",
8687
"docs",
8788
"doctests",
8889
"doctests",
90+
"doctests",
8991
"docfx",
9092
"format",
9193
]
@@ -172,6 +174,22 @@ def mypy(session):
172174
session.run("mypy", "-p", "google.cloud.datastore")
173175

174176

177+
@nox.session(python=DEFAULT_PYTHON_VERSION)
178+
def mypy(session):
179+
"""Verify type hints are mypy compatible."""
180+
session.install("-e", ".")
181+
# Exclude types-protobuf==4.24.0.20240106
182+
# See https://github.com/python/typeshed/issues/11254
183+
session.install(
184+
"mypy",
185+
"types-setuptools",
186+
"types-mock",
187+
"types-protobuf!=4.24.0.20240106",
188+
"types-requests",
189+
)
190+
session.run("mypy", "-p", "google.cloud.datastore")
191+
192+
175193
@nox.session(python=DEFAULT_PYTHON_VERSION)
176194
def lint_setup_py(session):
177195
"""Verify that setup.py is valid (including RST check)."""
@@ -311,6 +329,10 @@ def system(session, disable_grpc):
311329
if disable_grpc:
312330
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
313331

332+
env = {}
333+
if disable_grpc:
334+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
335+
314336
# Run py.test against the system tests.
315337
if system_test_exists:
316338
session.run(
@@ -387,6 +409,10 @@ def doctests(session):
387409
session.install("mock", "pytest", "sphinx", "google-cloud-testutils")
388410
session.install("-e", ".")
389411

412+
env = {}
413+
if disable_grpc:
414+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
415+
390416
env = {}
391417
if disable_grpc:
392418
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
@@ -402,6 +428,10 @@ def doctests(session):
402428
session.install("mock", "pytest", "sphinx", "google-cloud-testutils")
403429
session.install("-e", ".")
404430

431+
env = {}
432+
if disable_grpc:
433+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
434+
405435
# Run py.test against the system tests.
406436
session.run("py.test", "tests/doctests.py")
407437

0 commit comments

Comments
 (0)