Skip to content

Commit 95e484b

Browse files
1 parent ed3c79d commit 95e484b

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
@@ -80,6 +80,7 @@
8080
"mypy",
8181
"mypy",
8282
"mypy",
83+
"mypy",
8384
"cover",
8485
"lint",
8586
"lint_setup_py",
@@ -88,6 +89,7 @@
8889
"doctests",
8990
"doctests",
9091
"doctests",
92+
"doctests",
9193
"docfx",
9294
"format",
9395
]
@@ -190,6 +192,22 @@ def mypy(session):
190192
session.run("mypy", "-p", "google.cloud.datastore")
191193

192194

195+
@nox.session(python=DEFAULT_PYTHON_VERSION)
196+
def mypy(session):
197+
"""Verify type hints are mypy compatible."""
198+
session.install("-e", ".")
199+
# Exclude types-protobuf==4.24.0.20240106
200+
# See https://github.com/python/typeshed/issues/11254
201+
session.install(
202+
"mypy",
203+
"types-setuptools",
204+
"types-mock",
205+
"types-protobuf!=4.24.0.20240106",
206+
"types-requests",
207+
)
208+
session.run("mypy", "-p", "google.cloud.datastore")
209+
210+
193211
@nox.session(python=DEFAULT_PYTHON_VERSION)
194212
def lint_setup_py(session):
195213
"""Verify that setup.py is valid (including RST check)."""
@@ -333,6 +351,10 @@ def system(session, disable_grpc):
333351
if disable_grpc:
334352
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
335353

354+
env = {}
355+
if disable_grpc:
356+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
357+
336358
# Run py.test against the system tests.
337359
if system_test_exists:
338360
session.run(
@@ -417,6 +439,10 @@ def doctests(session):
417439
if disable_grpc:
418440
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
419441

442+
env = {}
443+
if disable_grpc:
444+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
445+
420446
# Run py.test against the system tests.
421447
session.run("py.test", "tests/doctests.py")
422448

@@ -428,6 +454,10 @@ def doctests(session):
428454
session.install("mock", "pytest", "sphinx", "google-cloud-testutils")
429455
session.install("-e", ".")
430456

457+
env = {}
458+
if disable_grpc:
459+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
460+
431461
env = {}
432462
if disable_grpc:
433463
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"

0 commit comments

Comments
 (0)