From 8bcb7afe1c4a0051235b1910d4ab5a6c1f3bae45 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 5 Mar 2022 07:51:28 +0100 Subject: [PATCH] Run tests with all PyPy versions locally PyPy 7.3.9 added `pypy3.x.exe` for Windows packages and it's now possible to do this on every OS (was already possible on Linux & macOS). This also allows to simplify the GHA test workflow. --- .github/workflows/test.yml | 13 ++++++------- noxfile.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f5c20228..4ce84596 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,10 +35,9 @@ jobs: cache: "pip" - name: Run nox - run: pipx run nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }} - if: ${{ ! startsWith( matrix.python_version, 'pypy' ) }} - - # Binary is named 'pypy3', but setup-python specifies it as 'pypy-3.x'. - - name: Run nox for pypy3 - run: pipx run nox --error-on-missing-interpreters -s tests-pypy3 - if: ${{ startsWith( matrix.python_version, 'pypy' ) }} + run: | + # Need to fix-up PyPy. This can be removed once https://github.com/actions/setup-python/issues/346 lands. + INTERPRETER=${{ matrix.python_version }} + INTERPRETER=${INTERPRETER/-/} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name + pipx run nox --error-on-missing-interpreters -s tests-${INTERPRETER} + shell: bash diff --git a/noxfile.py b/noxfile.py index c8f30eae..b61a713b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -21,7 +21,7 @@ nox.options.reuse_existing_virtualenvs = True -@nox.session(python=["3.7", "3.8", "3.9", "3.10", "pypy3"]) +@nox.session(python=["3.7", "3.8", "3.9", "3.10", "pypy3.7", "pypy3.8", "pypy3.9"]) def tests(session): def coverage(*args): session.run("python", "-m", "coverage", *args)