Repository navigation
Fix!: Require Python 3.11 or newer - #258
ModeSevenIndustrialSolutions merged 3 commits into
Conversation
Python 3.10 reached end of life in October 2026 and the organisation minimum is now Python 3.11. Refuse an older python_version in the first step, after its format check and before any step installs uv, Python or packages, with an error naming the input and the minimum. Add a python-version-minimum job that runs the action with 3.10, 3.10.12 and 2.7 and expects a failure that leaves no trace of setup-uv, plus a 3.11 leg that proves the probe is live. BREAKING CHANGE: callers passing a python_version below 3.11 now fail in the action's first step. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
With python_version 3.11 or newer enforced, the tox<4.0.0 pin for Python 3.8 and the tomli backport for Python 3.10 and older can never apply. Always install current tox with tox-uv, stop installing tomli into the test environment, and import tomllib directly in the coverage helpers, which drops detect_coverage.py's exit status 2. Raise basedpyright's pythonVersion to 3.11 to match the new minimum. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Drop 3.10 from the python-nss-ng regression matrix, since the action now refuses it, and raise the coverage fixtures' requires-python and the README's pytest_args examples to 3.11, the supported minimum. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review findings remain for the change raising the minimum supported Python version to 3.11.
No open issues 🎉
What changed in this PR
Raises the action’s minimum supported Python version to 3.11 for #256, aligning it with the organisation baseline. This is a breaking change for callers requesting older versions.
Changes:
- Rejects Python versions below 3.11 before installing tools or dependencies.
- Removes legacy tox handling and the
tomlifallback. - Adds minimum-version workflow checks and updates the regression matrix, fixtures, type-checking target, and documentation.
| File | Description |
|---|---|
scripts/detect_coverage.py |
Updates documentation to remove fallback and exit-code references. |
scripts/coverage_config.py |
Imports standard-library tomllib directly. |
README.md |
Documents the minimum and updates examples to 3.11. |
pyproject.toml |
Raises the type-checking target to Python 3.11. |
action.yaml |
Adds early version rejection and removes legacy dependency handling. |
.github/workflows/testing.yaml |
Adds minimum-version checks and removes the 3.10 regression leg. |
.fixtures/src-layout-pkg-source/pyproject.toml |
Raises the fixture’s minimum Python version to 3.11. |
.fixtures/src-layout-path-source/pyproject.toml |
Raises the fixture’s minimum Python version to 3.11. |
.fixtures/omit-excludes-install/pyproject.toml |
Raises the fixture’s minimum Python version to 3.11. |
.fixtures/flat-layout-no-config/pyproject.toml |
Raises the fixture’s minimum Python version to 3.11. |
.fixtures/addopts-cov-only/pyproject.toml |
Raises the fixture’s minimum Python version to 3.11. |
Review effort: Balanced
There was a problem hiding this comment.
🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.
The Python 3.11 minimum is enforced before installation, and removing the older-Python compatibility paths is consistent with the verified interpreter setup. The workflow adds rejection and minimum-version success coverage; no actionable defects found in the diff.
Antagonistic round 1 of 3.
Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.
557659d
into
lfreleng-actions:main
#258 made Python 3.11 the minimum and removed the tomli fallbacks from scripts/coverage_config.py and scripts/detect_coverage.py, but the basedpyright hook still installed tomli==2.4.1. Nothing the hook scans imports tomli any more, so the dependency only enlarged the hook environment. The code monkey bot could not make this edit: .pre-commit-config.yaml is protected gate configuration for it, as #258 noted. Part of lfreleng-actions/.github#362. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Closes #256
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI08e9a0abc1feac7e35786fa6eae18efd34dbc449uv venv /tmp/cm-venv -p 3.11 && /tmp/cm-venv/bin/python -m pytest -q testsprek run --files <all 11 changed files>uvx zizmor --persona auditor .github/workflows/testing.yaml action.yamlnpx aislop@0.13.1 scan --json --base 08e9a0abc1feac7e35786fa6eae18efd34dbc449 .git log --raw --format=%h 08e9a0abc1feac7e35786fa6eae18efd34dbc449..HEADThe
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.
What changed and why
Python 3.10 reached end of life in October 2026, and the organisation minimum is now 3.11 (lfreleng-actions/.github#362). This PR makes the action require 3.11 and removes the code that only existed for older Pythons. It has three commits:
Fix!: Refuse a python_version below 3.11: the first step (Setup action/environment) now rejects apython_versionbelow 3.11. The check runs right after the existingX.Y/X.Y.Zformat check and before any step installs uv, Python or packages. It fails with::error::python_version '<value>' is not supported; the minimum is 3.11. The comparison uses10#so bash does not read a leading zero as octal. A newpython-version-minimumjob intesting.yamlruns the action with3.10,3.10.12and2.7and expects a failure in which setup-uv never ran (UV_TOOL_BIN_DIRandUV_PYTHON_INSTALL_DIRstay unset). Its3.11leg expects success, which shows the probe works. This follows the existinguv-no-modify-pathjob. The input description and the README inputs table now state the minimum.Refactor: Drop support code for Python < 3.11: tox is now always installed as currenttoxwithtox-uv, so thetox<4.0.0branch for 3.8 is gone. The action no longer installstomliinto the test environment, andscripts/coverage_config.pyimportstomllibdirectly. As a result,detect_coverage.pyloses its exit status 2 (no TOML parser). basedpyright'spythonVersionis now3.11.Chore: Move tests and examples to Python 3.11:3.10is removed from the python-nss-ng regression matrix. The five fixtures now declarerequires-python = ">=3.11", and the READMEpytest_argsexamples use3.11.Behaviour change for callers
Breaking: a caller that passes
python_versionbelow 3.11 (3.8, 3.9, 3.10 or any patch release of them) now fails in the action's first step with the error above. Before this change the run went ahead. Such callers must move to 3.11 or newer.What I ran
python -m pytest -q testson a uv-managed Python 3.11: 78 passed.prek run --files <every changed file>: all hooks passed (yamllint, actionlint with shellcheck, basedpyright, ruff, markdownlint, reuse, codespell, gitlint at commit time, aislop and the others).zizmor --persona auditor .github/workflows/testing.yaml action.yaml: no findings.aislop scan --json --base <base>: no diagnostics, and every engine ran.3.10,3.10.12,2.7,3.9and3.08are refused;3.11,3.13.1and4.0are accepted.Things a reviewer may question
3.10mentions remain only in the new negative-test matrix, as inputs the action must refuse. Those mentions are deliberate.detect_coverage.pyno longer documents exit status 2. Nothing inaction.yamlchecked for that code.tomlientry in.pre-commit-config.yamlstays because of the protected-file limit described in the banner above.tox-run-action'sunsupported-pythonpath from this session. The refusal message here follows this repository's own error style, using::error::like theUV_NO_MODIFY_PATHrefusal.