Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
35 changes: 30 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,33 @@
"docs/conf.py",
]

DEFAULT_PYTHON_VERSION = "3.10"
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1787):
# Remove or restore testing for Python 3.7/3.8
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]

# Error if a python version is missing
nox.options.error_on_missing_interpreters = True

# pypy will be run as a github action instead of through Kokoro
nox.options.sessions = [
"lint",
"blacken",
"mypy",
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1787):
# Remove or restore testing for Python 3.7/3.8
"unit-3.9",
"unit-3.10",
"unit-3.11",
"unit-3.12",
"unit-3.13",
# cover must be last to avoid error `No data to report`
"cover",
"docs",
]


@nox.session(python="3.8")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session):
session.install(
"flake8", "flake8-import-order", "docutils", CLICK_VERSION, BLACK_VERSION
Expand All @@ -54,7 +79,7 @@ def lint(session):
)


@nox.session(python="3.8")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def blacken(session):
"""Run black.
Format code to uniform standard.
Expand All @@ -67,7 +92,7 @@ def blacken(session):
session.run("black", *BLACK_PATHS)


@nox.session(python="3.8")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def mypy(session):
"""Verify type hints are mypy compatible."""
session.install("-e", ".")
Expand All @@ -84,7 +109,7 @@ def mypy(session):
session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async")


@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"])
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
def unit(session):
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
Expand All @@ -102,7 +127,7 @@ def unit(session):
)


@nox.session(python="3.8")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def cover(session):
session.install("-e", ".[testing]")
session.run(
Expand Down
4 changes: 2 additions & 2 deletions system_tests/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def configure_cloud_sdk(session, application_default_credentials, project=False)

TEST_DEPENDENCIES_ASYNC = ["aiohttp", "pytest-asyncio", "nest-asyncio", "mock"]
TEST_DEPENDENCIES_SYNC = ["pytest", "requests", "mock", "pyjwt"]
PYTHON_VERSIONS_ASYNC = ["3.7"]
PYTHON_VERSIONS_SYNC = ["3.7"]
PYTHON_VERSIONS_ASYNC = ["3.10"]
PYTHON_VERSIONS_SYNC = ["3.10"]


def default(session, *test_paths):
Expand Down