diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 6b6e9be..21ec706 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -22,10 +22,16 @@ jobs: steps: - uses: actions/checkout@v3 + # Every interpreter in the tox.ini envlist must exist or tox cannot create + # that environment. The *last* entry becomes the default `python`, so keep + # 3.11 last: `uv python pin 3.11` and `make build` below are unaffected. - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: | + 3.9 + 3.10 + 3.11 - name: Install pypa/build run: | diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 5486837..c508531 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -11,11 +11,16 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - # Set up python 3.9 + # Set up every interpreter in the tox.ini envlist. The *last* entry becomes + # the default `python`, so keep 3.9 last: `make test` stays on the + # requires-python = ">=3.9" floor, and only tox reaches for 3.10/3.11. - name: Prepare python env uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: | + 3.11 + 3.10 + 3.9 # Install uv - name: Install uv @@ -24,3 +29,11 @@ jobs: # Pack and publish Python SDK - name: Exec py client unit test run: make test + + # Exercise tox on every PR instead of only at release time. + # tox >= 4.31 requires Python >= 3.10, so install it with 3.11 to resolve + # the same tox release the publish workflow uses. + - name: Install tox + run: python3.11 -m pip install tox + - name: Run tox + run: python3.11 -m tox diff --git a/tox.ini b/tox.ini index 6f73678..2568d88 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,12 @@ [tox] envlist = py{39,310,311} +# Fail loudly when an interpreter in envlist is missing instead of silently +# skipping that environment. tox <= 4.30 skips by default, tox >= 4.31 fails, +# so pin the behaviour explicitly to keep CI results identical regardless of +# which tox version the runner resolves. +skip_missing_interpreters = false + # Define the minimal tox version required to run; # if the host tox is less than this the tool with create an environment and # provision it with a tox that satisfies it under provision_tox_env.