@@ -40,12 +40,12 @@ jobs:
4040 run : uv run --frozen pytest
4141
4242
43- # Older pythons, down to the oldest one that the GitHub-hosted runners can
44- # still provide. 'uv.lock' deliberately covers python 3.10 and later only
45- # (see [tool.uv.dependency-groups] in pyproject.toml), so pytest is resolved
46- # on the fly here and uv picks whichever release still supports the
47- # interpreter. These runs are therefore not pinned; a pytest release could
48- # in principle break them without any change on our side.
43+ # Older pythons that the runner images still provide an interpreter for.
44+ # 'uv.lock' deliberately covers python 3.10 and later only (see
45+ # [tool.uv.dependency-groups] in pyproject.toml), so pytest is resolved on the
46+ # fly here and uv picks whichever release still supports the interpreter.
47+ # These runs are therefore not pinned; a pytest release could in principle
48+ # break them without any change on our side.
4949 #
5050 # The library is pure python and has no runtime dependencies, so there is
5151 # nothing to build: it is used straight from the source tree via PYTHONPATH.
@@ -55,15 +55,15 @@ jobs:
5555 # fail-fast: true
5656 matrix :
5757 python-version :
58- - " 3.7"
5958 - " 3.8"
6059 - " 3.9"
6160
62- # 'ubuntu-22.04' is the newest runner image for which 'actions/setup-python'
63- # still provides python 3.7. uv's own python downloads only start at 3.8,
64- # which is why the interpreter comes from 'actions/setup-python' here and
65- # from 'astral-sh/setup-uv' in the job above.
66- runs-on : ' ubuntu-22.04'
61+ # 'actions/setup-python' publishes prebuilt interpreters per runner image.
62+ # For python 3.8 and 3.9 the newest image it builds them for is ubuntu
63+ # 24.04, so that is what we ask for rather than 'ubuntu-latest' — the
64+ # 'latest' label moves on to newer images over time and would eventually
65+ # leave these two versions behind without warning.
66+ runs-on : ' ubuntu-24.04'
6767
6868 steps :
6969 - uses : actions/checkout@v4
8787 run : >-
8888 uv run --no-project --python "$(which python)" --with pytest
8989 pytest
90+
91+
92+ # The two oldest pythons we still advertise, run inside the official docker
93+ # images for those versions.
94+ #
95+ # These cannot go through 'actions/setup-python' at all. That action installs
96+ # interpreters that were prebuilt for a specific runner image, and the newest
97+ # image python 3.6 was ever built for is ubuntu 20.04, which has been retired;
98+ # for python 3.7 it is ubuntu 22.04, whose retirement is already scheduled.
99+ # Building these versions from source instead (with pyenv, say) runs into a
100+ # second wall: ubuntu 22.04 and later ship OpenSSL 3, which python 3.6
101+ # predates, so its secure-sockets module will not compile without supplying an
102+ # older OpenSSL first.
103+ #
104+ # The official images sidestep both problems. They stopped being updated when
105+ # each version reached end of life, which is exactly what we want here: a
106+ # frozen, genuine interpreter of that vintage.
107+ #
108+ # Note the container is used for the test step only, rather than as a
109+ # job-level 'container:'. Anything declared that way makes GitHub run its own
110+ # tooling inside the image, and that tooling needs a newer system C library
111+ # than these old images carry. Checking out on the runner and mounting the
112+ # working directory keeps all of that on the host, where it is fine, and
113+ # leaves the container with nothing to do but install pytest and run it.
114+ tests-ci-oldest :
115+
116+ strategy :
117+ # fail-fast: true
118+ matrix :
119+ # Full versions, because they name the image tag: these are the final
120+ # releases of each series, and no further ones are coming.
121+ python-version :
122+ - " 3.6.15"
123+ - " 3.7.17"
124+
125+ runs-on : ' ubuntu-latest'
126+
127+ steps :
128+ - uses : actions/checkout@v4
129+
130+ # pytest is left unpinned for the same reason as in the job above. pip
131+ # honours each release's declared python requirement, so this settles on
132+ # pytest 7.0.1 under python 3.6 (7.1 was the first to drop it) and on the
133+ # last 7.x supporting python 3.7.
134+ #
135+ # Writing no bytecode keeps the container from leaving root-owned '.pyc'
136+ # files behind in the mounted working directory.
137+ - name : ' Run tests on python ${{ matrix.python-version }}'
138+ run : |
139+ docker run --rm \
140+ --volume "$PWD:/src" \
141+ --workdir /src \
142+ --env PYTHONDONTWRITEBYTECODE=1 \
143+ "python:${{ matrix.python-version }}-slim" \
144+ sh -c 'pip install --quiet --no-cache-dir --disable-pip-version-check pytest && python -m pytest'
0 commit comments