Skip to content

Commit d54f329

Browse files
1 parent 95e484b commit d54f329

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
@@ -81,6 +81,7 @@
8181
"mypy",
8282
"mypy",
8383
"mypy",
84+
"mypy",
8485
"cover",
8586
"lint",
8687
"lint_setup_py",
@@ -90,6 +91,7 @@
9091
"doctests",
9192
"doctests",
9293
"doctests",
94+
"doctests",
9395
"docfx",
9496
"format",
9597
]
@@ -208,6 +210,22 @@ def mypy(session):
208210
session.run("mypy", "-p", "google.cloud.datastore")
209211

210212

213+
@nox.session(python=DEFAULT_PYTHON_VERSION)
214+
def mypy(session):
215+
"""Verify type hints are mypy compatible."""
216+
session.install("-e", ".")
217+
# Exclude types-protobuf==4.24.0.20240106
218+
# See https://github.com/python/typeshed/issues/11254
219+
session.install(
220+
"mypy",
221+
"types-setuptools",
222+
"types-mock",
223+
"types-protobuf!=4.24.0.20240106",
224+
"types-requests",
225+
)
226+
session.run("mypy", "-p", "google.cloud.datastore")
227+
228+
211229
@nox.session(python=DEFAULT_PYTHON_VERSION)
212230
def lint_setup_py(session):
213231
"""Verify that setup.py is valid (including RST check)."""
@@ -355,6 +373,10 @@ def system(session, disable_grpc):
355373
if disable_grpc:
356374
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
357375

376+
env = {}
377+
if disable_grpc:
378+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
379+
358380
# Run py.test against the system tests.
359381
if system_test_exists:
360382
session.run(
@@ -443,6 +465,10 @@ def doctests(session):
443465
if disable_grpc:
444466
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
445467

468+
env = {}
469+
if disable_grpc:
470+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
471+
446472
# Run py.test against the system tests.
447473
session.run("py.test", "tests/doctests.py")
448474

@@ -462,6 +488,10 @@ def doctests(session):
462488
if disable_grpc:
463489
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
464490

491+
env = {}
492+
if disable_grpc:
493+
env["GOOGLE_CLOUD_DISABLE_GRPC"] = "True"
494+
465495
# Run py.test against the system tests.
466496
session.run("py.test", "tests/doctests.py")
467497

0 commit comments

Comments
 (0)