Skip to content

ci: single-source the Python version (.python-version) with a consistency guard - #81

Merged
carolsimone merged 1 commit into
mainfrom
ci/pin-python-version
Oct 10, 2026
Merged

carolsimone merged 1 commit into
mainfrom
ci/pin-python-version

Conversation

@carolsimone

Copy link
Copy Markdown
Owner

CPython 3.15.0 released 2026-10-10. The Python version was hardcoded in ~17 places with no pin, so uv sync picked 3.15 in CI and pyarrow==25.0.1 fell back to a (failing) source build — breaking test and all integration-* jobs at the dependency-install step, on every branch.

This makes .python-version the single source of truth and enforces it:

  • .python-version = 3.14.2 — the exact interpreter dev, CI and the shipped images run.
  • Engine Dockerfiles (postgres/trino/duckdb) + template/Dockerfile.pip pin the same exact patch: FROM python:3.14.2-slim.
  • requires-python floor, mypy python_version, trove classifiers, and setup-python inputs track its major.minor (3.14) — mypy and requires-python reject a patch component, and keeping the host-probe setup-python at the minor avoids a brand-new patch missing from its manifest breaking CI; the image carries the exact patch, which is what actually ships.
  • A pattern-scanning guard (tests/test_python_version_consistency.py) reads .python-version and fails on any drift. It discovers pyproject.toml / Dockerfile* / workflow files by directory scan, so a new adapter, image or workflow is covered without editing the guard. Verified: injecting a wrong version fails the dockerfile, pyproject and workflow checks; reverting passes.

To bump Python in future: edit .python-version (and the images' slim tag), and the guard keeps the rest honest.

Merge this first; the write-modes stack (#75–#80) then rebases onto main and inherits the pin and guard.

🤖 Generated with Claude Code

https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw

CPython 3.15.0 (2026-10-10) exposed that the Python version was hardcoded in
~17 places with no pin, so uv picked 3.15 in CI and pyarrow fell back to a
failing source build. Pin it in one place — .python-version = 3.14.2 — and
make everything track it: the engine Dockerfiles use the same exact patch
(python:3.14.2-slim); requires-python, mypy python_version, the trove
classifiers and setup-python inputs match its major.minor. A pattern-scanning
guard (tests/test_python_version_consistency.py) reads .python-version and
fails on any drift, discovering pyproject.toml / Dockerfile* / workflow files
by directory scan so new ones are covered without editing the guard.

Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw
@carolsimone carolsimone self-assigned this Oct 10, 2026
@carolsimone carolsimone added the dependencies Pull requests that update a dependency file label Oct 10, 2026
@carolsimone
carolsimone merged commit 7544f03 into main Oct 10, 2026
28 checks passed
@carolsimone
carolsimone deleted the ci/pin-python-version branch October 10, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant