From fdac5fbf7c1c3b63b6f3067734a10db0b409e28c Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 23 Aug 2021 15:05:54 -0700 Subject: [PATCH] chore: support targeting different Python versions with nox (#3214) --- .github/CONTRIBUTING.md | 4 ++-- noxfile.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ff1997f98..39c32b2ac 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -68,8 +68,8 @@ nox -l # Run linters nox -s lint -# Run tests -nox -s tests +# Run tests on Python 3.9 +nox -s tests-3.9 # Build and preview docs nox -s docs -- serve diff --git a/noxfile.py b/noxfile.py index 55b1d180b..234179821 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,6 +2,8 @@ import nox nox.options.sessions = ["lint", "tests", "tests_packaging"] +PYTHON_VERISONS = ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + @nox.session(reuse_venv=True) def lint(session: nox.Session) -> None: @@ -12,7 +14,7 @@ def lint(session: nox.Session) -> None: session.run("pre-commit", "run", "-a") -@nox.session +@nox.session(python=PYTHON_VERISONS) def tests(session: nox.Session) -> None: """ Run the tests (requires a compiler).