Skip to content

Commit 72280e2

Browse files
committed
updates to noxfile sessions, versions and creds check.
1 parent 41cc787 commit 72280e2

1 file changed

Lines changed: 42 additions & 11 deletions

File tree

packages/pandas-gbq/noxfile.py

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@
3434

3535
DEFAULT_PYTHON_VERSION = "3.14"
3636

37-
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
37+
UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
38+
39+
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
40+
ALL_PYTHON.extend(["3.7"])
41+
3842
UNIT_TEST_STANDARD_DEPENDENCIES = [
3943
"mock",
4044
"asyncmock",
@@ -220,7 +224,7 @@ def default(session):
220224
)
221225

222226

223-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
227+
@nox.session(python=ALL_PYTHON)
224228
@_calculate_duration
225229
def unit(session):
226230
"""Run the unit test suite."""
@@ -272,6 +276,10 @@ def system(session):
272276
# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
273277
if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
274278
session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
279+
280+
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS"):
281+
session.skip("Credentials are required to run system tests")
282+
275283
# Install pyopenssl for mTLS testing.
276284
if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":
277285
session.install("pyopenssl")
@@ -310,7 +318,7 @@ def system(session):
310318

311319
@nox.session(python=DEFAULT_PYTHON_VERSION)
312320
@_calculate_duration
313-
def prerelease(session):
321+
def prerelease_deps(session):
314322
session.install(
315323
# https://arrow.apache.org/docs/developers/python.html#installing-nightly-packages
316324
"--extra-index-url",
@@ -388,14 +396,19 @@ def prerelease(session):
388396
*session.posargs,
389397
)
390398

391-
session.run(
392-
"py.test",
393-
"--quiet",
394-
"-W default::PendingDeprecationWarning",
395-
f"--junitxml=prerelease_system_{session.python}_sponge_log.xml",
396-
os.path.join("tests", "system"),
397-
*session.posargs,
398-
)
399+
if os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
400+
session.run(
401+
"py.test",
402+
"--quiet",
403+
"-W default::PendingDeprecationWarning",
404+
f"--junitxml=prerelease_system_{session.python}_sponge_log.xml",
405+
os.path.join("tests", "system"),
406+
*session.posargs,
407+
)
408+
else:
409+
session.log(
410+
"Skipping system tests because GOOGLE_APPLICATION_CREDENTIALS is not set."
411+
)
399412

400413

401414
@nox.session(python=DEFAULT_PYTHON_VERSION)
@@ -502,3 +515,21 @@ def docfx(session):
502515
os.path.join("docs", ""),
503516
os.path.join("docs", "_build", "html", ""),
504517
)
518+
519+
520+
@nox.session(python=DEFAULT_PYTHON_VERSION)
521+
def mypy(session):
522+
"""Run the type checker."""
523+
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
524+
# Add mypy tests
525+
session.skip("mypy tests are not yet supported")
526+
527+
528+
@nox.session(python=DEFAULT_PYTHON_VERSION)
529+
def core_deps_from_source(session):
530+
"""Run all tests with core dependencies installed from source
531+
rather than pulling the dependencies from PyPI.
532+
"""
533+
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
534+
# Add core deps from source tests
535+
session.skip("Core deps from source tests are not yet supported")

0 commit comments

Comments
 (0)