Skip to content

Commit 500dc6d

Browse files
committed
fixing lock/dependabot min-python-supported-in-dev issues
1 parent 215ecf7 commit 500dc6d

4 files changed

Lines changed: 186 additions & 1795 deletions

File tree

‎.github/workflows/tests-ci.yml‎

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ on:
99
# - cron: "13 20 * * 3"
1010

1111
jobs:
12+
13+
# Python 3.10 and later, running against the development tooling that
14+
# 'uv.lock' pins. These runs are fully reproducible.
1215
tests-ci:
1316

1417
strategy:
1518
#fail-fast: true
1619
matrix:
17-
# These should span the range declared by 'requires-python' in
18-
# pyproject.toml. uv downloads whichever interpreter is missing from
19-
# the runner, so testing older pythons no longer needs an old (and by
20-
# now unavailable) runner image.
2120
python-version:
22-
- "3.8"
23-
- "3.9"
2421
- "3.10"
2522
- "3.11"
2623
- "3.12"
@@ -41,3 +38,52 @@ jobs:
4138

4239
- name: 'Run tests'
4340
run: uv run --frozen pytest
41+
42+
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.
49+
#
50+
# The library is pure python and has no runtime dependencies, so there is
51+
# nothing to build: it is used straight from the source tree via PYTHONPATH.
52+
tests-ci-oldpy:
53+
54+
strategy:
55+
#fail-fast: true
56+
matrix:
57+
python-version:
58+
- "3.7"
59+
- "3.8"
60+
- "3.9"
61+
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'
67+
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: 'Set up python ${{ matrix.python-version }}'
72+
uses: actions/setup-python@v5
73+
with:
74+
python-version: '${{ matrix.python-version }}'
75+
76+
- name: 'Set up uv'
77+
uses: astral-sh/setup-uv@v7
78+
with:
79+
enable-cache: true
80+
81+
# '--no-project' keeps uv from consulting uv.lock (which does not describe
82+
# this interpreter); '$(which python)' is the interpreter that
83+
# 'actions/setup-python' just put on the PATH.
84+
- name: 'Run tests (pytest resolved outside of uv.lock)'
85+
env:
86+
PYTHONPATH: '.'
87+
run: >-
88+
uv run --no-project --python "$(which python)" --with pytest
89+
pytest

‎CLAUDE.md‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,22 @@ Dependency groups (PEP 735, in `[dependency-groups]`): `dev` (pytest) is
6969
installed by a plain `uv sync`; `builddoc` (Sphinx) and `buildjslib`
7070
(Transcrypt, PyYAML) are opt-in via `--group`.
7171

72+
All three groups are locked for python 3.10 and later only, via
73+
`[tool.uv.dependency-groups]` in `pyproject.toml`. This concerns the
74+
development environment alone — the library keeps advertising python 3.6 and
75+
has no runtime dependencies — and it is what keeps `uv.lock` on current
76+
releases of the development tooling. Without that restriction uv has to
77+
resolve the groups for python 3.6 as well, and locks one package set per python
78+
version, reaching back to releases that are long unmaintained and carry
79+
published vulnerabilities. Do not widen it back without a good reason.
80+
7281
The supported python range is declared once, by `requires-python` in
73-
`pyproject.toml` (currently `>=3.6`). The `tests-ci` workflow matrix actually
74-
exercises 3.8 through 3.13, so the oldest declared versions (3.6 and 3.7) are
75-
not covered by continuous integration. Python 2 is not supported; do not
76-
reintroduce compatibility shims for it.
82+
`pyproject.toml` (currently `>=3.6`). The `tests-ci` workflow exercises 3.7
83+
through 3.13, in two jobs: 3.10 and later run against the locked tooling, while
84+
the older ones resolve pytest outside of `uv.lock` (and are correspondingly not
85+
reproducible). Only python 3.6 is left uncovered, because the GitHub-hosted
86+
runners no longer provide an interpreter that old. Python 2 is not supported;
87+
do not reintroduce compatibility shims for it.
7788

7889

7990
## Constraints when editing

‎pyproject.toml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ buildjslib = [
5858
"PyYAML>=5.0",
5959
]
6060

61+
# The development tooling does not have to run on every python version that the
62+
# library itself supports. Restricting the groups to python 3.10 and later lets
63+
# uv lock current releases of pytest, Sphinx and their dependencies. Without
64+
# this restriction the resolution has to accommodate python 3.6 (the
65+
# 'requires-python' value above), and uv then locks one set of packages per
66+
# python version, down to long-unmaintained releases for the oldest ones.
67+
#
68+
# This only concerns the development environment described by 'uv.lock'; the
69+
# library itself keeps advertising python 3.6 and has no runtime dependencies at
70+
# all. The test suite still runs on older pythons, with pytest resolved outside
71+
# of the lock file; see '.github/workflows/tests-ci.yml'.
72+
[tool.uv.dependency-groups]
73+
dev = { requires-python = ">=3.10" }
74+
builddoc = { requires-python = ">=3.10" }
75+
buildjslib = { requires-python = ">=3.10" }
76+
6177
[tool.uv]
6278
# Only "dev" is installed by a plain `uv sync`; "builddoc" and "buildjslib" are
6379
# opt-in via `--group`.

0 commit comments

Comments
 (0)