Skip to content

build: pin one Python version in .python-version (3.14) - #239

Merged
luca-belli merged 3 commits into
mainfrom
ci/single-python-version
Oct 2, 2026
Merged

luca-belli merged 3 commits into
mainfrom
ci/single-python-version

Conversation

@luca-belli

Copy link
Copy Markdown
Collaborator

Stacked on #236 → #235 → #234. Follows up the "why not 3.13?" thread on #235.

Summary

CI ran 3.11, local dev 3.13, and the Docker image 3.14, with nothing tying them together. Now .python-version (3.14) is the one place the version is set, and there's a single supported version:

  • CI: uv sync reads .python-version, so every job loses its hardcoded setup-python step (3 in ci.yml, 1 in live.yml).
  • pyproject.toml: requires-python goes from >=3.11 to >=3.14. Ruff's target-version is removed, because Ruff falls back to requires-python.
  • Docker: a FROM line can't read a file, so a new code-quality step fails if the Dockerfile's FROM python:X-slim disagrees with .python-version.
  • uv.lock: drops the wheels and markers for Python < 3.14. No package versions change for a 3.14 environment.
  • Formatting (separate commit): with a 3.14 target, Ruff rewrites except (A, B): as except A, B: (PEP 758). 13 lines across 7 files, formatting only.
  • Docs: AGENTS.md and docs/ARCHITECTURE-SPINE.md.

Breaking for anyone installing outside Docker on Python 3.11–3.13: uv sync now requires 3.14. Locally, uv sync rebuilds .venv on 3.14 and downloads it if needed.

Test plan

  • uv run pytest -m "not live" on Python 3.14.6: 1173 passed
  • ruff format --check . and ruff check . pass
  • The Dockerfile check passes against the current FROM python:3.14-slim
  • CI green, with jobs installing 3.14 through uv

🤖 Generated with Claude Code

if current_index + 1 < len(self.question_order):
return self.question_order[current_index + 1]
except (ValueError, AttributeError):
except ValueError, AttributeError:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

weird flex but ok

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ha, agreed, it reads oddly. It is PEP 758: from 3.14 the parentheses are optional when an except lists several exceptions without as. Ruff 3.14 formatting drops them, so they stay gone as long as Ruff formats the code. If the team would rather keep them, the only way is to set Ruff's target back below 3.14, which brings back the second version number this PR removes.

@jgieringer jgieringer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@luca-belli
luca-belli force-pushed the ci/single-python-version branch from 2c18f67 to 9c204cf Compare October 1, 2026 21:31
luca-belli and others added 2 commits October 1, 2026 14:32
CI ran 3.11, local dev 3.13, and the Docker image 3.14, with nothing
tying them together. `.python-version` is now the one place the version
is set:

- `uv sync` reads it, so the workflows drop their hardcoded
  `setup-python` steps.
- `requires-python` becomes ">=3.14", and ruff's `target-version` is
  removed so ruff reads it from there.
- The code-quality job fails if the Dockerfile's `FROM` line disagrees,
  since a `FROM` line cannot read the file.

The lockfile loses the wheels and markers for Python < 3.14; no package
version changes for a 3.14 environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the target now 3.14, ruff drops the parentheses around multi-exception
`except` clauses (PEP 758). Formatting only; no behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@luca-belli
luca-belli force-pushed the ci/single-python-version branch from 9c204cf to 827e4ca Compare October 1, 2026 21:32
Base automatically changed from ci/live-tests-job to main October 2, 2026 20:08
Resolve the live.yml conflict with the self-hosted runner change (#236).
Keep main's runner comment, but drop the python-version: '3.11' that
main added to setup-uv, so the live job uses .python-version like the
rest of CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@luca-belli
luca-belli merged commit 45a6a06 into main Oct 2, 2026
4 checks passed
@luca-belli
luca-belli deleted the ci/single-python-version branch October 2, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants