Skip to content

Fix!: Require Python 3.11 or newer - #258

Merged
ModeSevenIndustrialSolutions merged 3 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-256
Nov 15, 2026
Merged

ModeSevenIndustrialSolutions merged 3 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-256

Conversation

@lf-releng-code-monkey-bot

Copy link
Copy Markdown
Contributor

Closes #256

Authored by an AI agent; human review required
Command Exit
uv venv /tmp/cm-venv -p 3.11 && /tmp/cm-venv/bin/python -m pytest -q tests 0
prek run --files <all 11 changed files> 0
uvx zizmor --persona auditor .github/workflows/testing.yaml action.yaml 0
npx aislop@0.13.1 scan --json --base 08e9a0abc1feac7e35786fa6eae18efd34dbc449 . 0
git log --raw --format=%h 08e9a0abc1feac7e35786fa6eae18efd34dbc449..HEAD 0

The github-code-monkey-bot workflow 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.


INFO
One follow-up needs a human: drop "tomli==2.4.1" from the basedpyright hook's additional_dependencies in .pre-commit-config.yaml. This workflow cannot edit that file because it is protected gate configuration. The entry is now unused but harmless: nothing imports tomli, and basedpyright targets 3.11.

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:

  1. Fix!: Refuse a python_version below 3.11: the first step (Setup action/environment) now rejects a python_version below 3.11. The check runs right after the existing X.Y/X.Y.Z format 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 uses 10# so bash does not read a leading zero as octal. A new python-version-minimum job in testing.yaml runs the action with 3.10, 3.10.12 and 2.7 and expects a failure in which setup-uv never ran (UV_TOOL_BIN_DIR and UV_PYTHON_INSTALL_DIR stay unset). Its 3.11 leg expects success, which shows the probe works. This follows the existing uv-no-modify-path job. The input description and the README inputs table now state the minimum.
  2. Refactor: Drop support code for Python < 3.11: tox is now always installed as current tox with tox-uv, so the tox<4.0.0 branch for 3.8 is gone. The action no longer installs tomli into the test environment, and scripts/coverage_config.py imports tomllib directly. As a result, detect_coverage.py loses its exit status 2 (no TOML parser). basedpyright's pythonVersion is now 3.11.
  3. Chore: Move tests and examples to Python 3.11: 3.10 is removed from the python-nss-ng regression matrix. The five fixtures now declare requires-python = ">=3.11", and the README pytest_args examples use 3.11.

Behaviour change for callers

Breaking: a caller that passes python_version below 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 tests on 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.
  • I checked the bash comparison by hand: 3.10, 3.10.12, 2.7, 3.9 and 3.08 are refused; 3.11, 3.13.1 and 4.0 are accepted.
  • I did not run the workflow jobs, including the new negative test, locally. CI on this PR runs them.

Things a reviewer may question

  • Other 3.10 mentions remain only in the new negative-test matrix, as inputs the action must refuse. Those mentions are deliberate.
  • detect_coverage.py no longer documents exit status 2. Nothing in action.yaml checked for that code.
  • The tomli entry in .pre-commit-config.yaml stays because of the protected-file limit described in the banner above.
  • I could not read tox-run-action's unsupported-python path from this session. The refusal message here follows this repository's own error style, using ::error:: like the UV_NO_MODIFY_PATH refusal.

lf-releng-code-monkey-bot Bot and others added 3 commits November 15, 2026 11:44
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 tomli fallback.
  • 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 557659d into lfreleng-actions:main Nov 15, 2026
38 checks passed
ModeSevenIndustrialSolutions added a commit that referenced this pull request Nov 15, 2026
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Change potentially breaks upgrades

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Require Python 3.11 or newer

2 participants