From 07c014129c702aa7bf8fc98858aa674b1e2d8cfb Mon Sep 17 00:00:00 2001 From: Zac-HD Date: Wed, 20 Oct 2021 23:00:39 +1100 Subject: [PATCH] Test on pypy3.8 in CI --- .github/workflows/main.yml | 1 + hypothesis-python/tox.ini | 2 +- tooling/src/hypothesistooling/__main__.py | 22 ++++++++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1da36127d8..3f14a101ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,6 +28,7 @@ jobs: - check-py37 - check-pypy37 - check-py38 + - check-pypy38 - check-py39 - check-py310 - check-quality diff --git a/hypothesis-python/tox.ini b/hypothesis-python/tox.ini index 1b030385af..db4cb16c35 100644 --- a/hypothesis-python/tox.ini +++ b/hypothesis-python/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{36,py36,37,py37,38,39,310}-{brief,prettyquick,full,custom} +envlist = py{36,py36,37,py37,38,py38,39,310}-{brief,prettyquick,full,custom} toxworkdir={env:TOX_WORK_DIR:.tox} [testenv] diff --git a/tooling/src/hypothesistooling/__main__.py b/tooling/src/hypothesistooling/__main__.py index 6c12e94a09..df08a8593a 100644 --- a/tooling/src/hypothesistooling/__main__.py +++ b/tooling/src/hypothesistooling/__main__.py @@ -360,21 +360,26 @@ def run_tox(task, version): # See update_python_versions() above +# When adding or removing a version, also update the env lists in tox.ini and +# workflows/main.yml, and the corresponding @python_tests function below. PY36 = "3.6.15" PY37 = "3.7.12" PY38 = PYMAIN = "3.8.12" # Sync PYMAIN minor version with GH Actions main.yml PY39 = "3.9.7" PY310 = "3.10.0" PYPY36 = "pypy3.6-7.3.3" -PYPY37 = "pypy3.7-7.3.5" +PYPY37 = "pypy3.7-7.3.6" +PYPY38 = "pypy3.8-7.3.6" # ALIASES are the executable names for each Python version -ALIASES = {PYPY36: "pypy3", PYPY37: "pypy3"} - -for n in [PY36, PY37, PY38, PY39, PY310]: - major, minor, patch = n.replace("-dev", ".").split(".") - ALIASES[n] = f"python{major}.{minor}" +ALIASES = {} +for name, value in list(globals().items()): + if name.startswith("PYPY"): + ALIASES[value] = "pypy3" + elif name.startswith("PY"): + major, minor, patch = value.replace("-dev", ".").split(".") + ALIASES[value] = f"python{major}.{minor}" python_tests = task( @@ -422,6 +427,11 @@ def check_pypy37(): run_tox("pypy3-full", PYPY37) +@python_tests +def check_pypy38(): + run_tox("pypy3-full", PYPY38) + + def standard_tox_task(name): TASKS["check-" + name] = python_tests(lambda: run_tox(name, PYMAIN))