ci(python): one Python (3.14) for the lock, a clone and the ci image #219

Merged
Defame1297 merged 2 commits from fix/renovate-lock-python-pin into main 2026-11-16 07:58:43 +00:00
Owner

What

.python-version (3.14) becomes the one source for the Python of the hashed lock, a developer clone's .venv and the ci image's /opt/venv.

  • scripts/dev-setup.sh and scripts/lock-requirements.sh require exactly that minor (clear errors for a missing or malformed file, or another interpreter). A .venv on another Python is rebuilt.
  • images/ci/Dockerfile: /opt/venv is built from the uv-installed python-build-standalone of ARG PYTHON_VERSION (declared in both stages) instead of the distribution's python3. The interpreters installed and linked as python<MINOR> for ansible-test are derived from it (3.11, 3.13 and the pin), no longer hardcoded.
  • check_image_versions.py pins has a new guard: it fails when .python-version, the header of requirements-dev.lock or any ARG PYTHON_VERSION of an image Dockerfile differ (tolerant of indentation, case, quotes, trailing comments, CRLF).
  • renovate.yml and CLAUDE.md document that the -full Renovate container runs pip-compile on its own python (RENOVATE_BINARY_SOURCE=global), whose minor version must equal .python-version.
  • galaxy.yml build_ignore gets .python-version; docs/images/ci.md and the image labels are updated. ci image version 0.2.25 -> 0.2.26.

Why

PR #203's lock refresh changed the header from Python 3.13 to 3.14: Renovate's -full container ran pip-compile on its own 3.14 and ignored the 3.13 it reads from the header. The three places that run the tools disagreed (clone: "3.13+", ci image: Ubuntu 26.04's python3, which is 3.14, lock header: whatever generated it). 3.14 is the version the ci image already ran on, and the lock content is identical when resolved on 3.14.

Verified

  • python3 -I -m unittest discover -s tests/scripts: 193 tests pass (new: guard cases, dev-setup refusing another minor, missing/malformed pin file, a check that the committed files agree).
  • check_image_versions.py pins and bump origin/main pass.
  • Lock regenerated with scripts/lock-requirements.sh on real Python 3.14: byte-identical to the lock on main (so this PR does not touch it).
  • Simulated the image's new venv steps locally: uv-installed 3.14.6, venv from the real interpreter path, pip install --require-hashes of the lock, ansible-core 2.22.0, pip check clean.
  • All pre-commit hooks pass; push-time ansible-test sanity passed.
  • Three read-only subagent reviews (scripts/guard/tests; Dockerfile; Renovate interplay). Findings applied: derive the Dockerfile's version lists from the ARG, validate the pin identically in both scripts, tolerant ARG regex, more tests. The Renovate review made me drop an earlier RENOVATE_BINARY_SOURCE=install change (the -full image already ships Python 3.14.8 and pip-tools 7.6.2; install would add runtime downloads and could replace the baked pip-tools).

Not verified

  • The image build itself: it runs only on main (kaniko, never on PRs) and there is no container runtime on the dev host. To check on the first build after merge: kaniko's handling of stage-level ARG in RUN; the compressed size of the /opt/python layer with a third interpreter (estimated about 20 MB more, limit 95 MiB); CA certificates for the baked Python during ansible-galaxy collection install. Each would fail loudly in the build, not silently.
  • A live Renovate run: after merge, run the workflow via workflow_dispatch (dry run) and confirm a lock refresh keeps the 3.14 header and gets the image version bump (PR #216).
  • This PR's own Lint takes the slower path only if a pin file differs from the baked checksums; the lock does not change here.

Notes

  • Your existing .venv is on 3.13; the next scripts/dev-setup.sh run rebuilds it on 3.14 (needs python3.14, or uv python install 3.14).
  • Moving the version later is one PR: .python-version, both ARG PYTHON_VERSION lines, the lock (scripts/lock-requirements.sh), the image version bump, and a check of the Renovate container's python.

🤖 Generated with Claude Code

## What `.python-version` (`3.14`) becomes the one source for the Python of the hashed lock, a developer clone's `.venv` and the `ci` image's `/opt/venv`. - `scripts/dev-setup.sh` and `scripts/lock-requirements.sh` require exactly that minor (clear errors for a missing or malformed file, or another interpreter). A `.venv` on another Python is rebuilt. - `images/ci/Dockerfile`: `/opt/venv` is built from the uv-installed python-build-standalone of `ARG PYTHON_VERSION` (declared in both stages) instead of the distribution's `python3`. The interpreters installed and linked as `python<MINOR>` for `ansible-test` are derived from it (3.11, 3.13 and the pin), no longer hardcoded. - `check_image_versions.py pins` has a new guard: it fails when `.python-version`, the header of `requirements-dev.lock` or any `ARG PYTHON_VERSION` of an image Dockerfile differ (tolerant of indentation, case, quotes, trailing comments, CRLF). - `renovate.yml` and `CLAUDE.md` document that the `-full` Renovate container runs `pip-compile` on its own python (`RENOVATE_BINARY_SOURCE=global`), whose minor version must equal `.python-version`. - `galaxy.yml` `build_ignore` gets `.python-version`; `docs/images/ci.md` and the image labels are updated. `ci` image version 0.2.25 -> 0.2.26. ## Why PR #203's lock refresh changed the header from Python 3.13 to 3.14: Renovate's `-full` container ran `pip-compile` on its own 3.14 and ignored the 3.13 it reads from the header. The three places that run the tools disagreed (clone: "3.13+", `ci` image: Ubuntu 26.04's `python3`, which is 3.14, lock header: whatever generated it). 3.14 is the version the `ci` image already ran on, and the lock content is identical when resolved on 3.14. ## Verified - `python3 -I -m unittest discover -s tests/scripts`: 193 tests pass (new: guard cases, `dev-setup` refusing another minor, missing/malformed pin file, a check that the committed files agree). - `check_image_versions.py pins` and `bump origin/main` pass. - Lock regenerated with `scripts/lock-requirements.sh` on real Python 3.14: byte-identical to the lock on `main` (so this PR does not touch it). - Simulated the image's new venv steps locally: uv-installed 3.14.6, venv from the real interpreter path, `pip install --require-hashes` of the lock, `ansible-core` 2.22.0, `pip check` clean. - All pre-commit hooks pass; push-time `ansible-test sanity` passed. - Three read-only subagent reviews (scripts/guard/tests; Dockerfile; Renovate interplay). Findings applied: derive the Dockerfile's version lists from the ARG, validate the pin identically in both scripts, tolerant `ARG` regex, more tests. The Renovate review made me drop an earlier `RENOVATE_BINARY_SOURCE=install` change (the `-full` image already ships Python 3.14.8 and pip-tools 7.6.2; `install` would add runtime downloads and could replace the baked pip-tools). ## Not verified - The image build itself: it runs only on `main` (kaniko, never on PRs) and there is no container runtime on the dev host. To check on the first build after merge: kaniko's handling of stage-level `ARG` in `RUN`; the compressed size of the `/opt/python` layer with a third interpreter (estimated about 20 MB more, limit 95 MiB); CA certificates for the baked Python during `ansible-galaxy collection install`. Each would fail loudly in the build, not silently. - A live Renovate run: after merge, run the workflow via `workflow_dispatch` (dry run) and confirm a lock refresh keeps the 3.14 header and gets the image version bump (PR #216). - This PR's own Lint takes the slower path only if a pin file differs from the baked checksums; the lock does not change here. ## Notes - Your existing `.venv` is on 3.13; the next `scripts/dev-setup.sh` run rebuilds it on 3.14 (needs `python3.14`, or `uv python install 3.14`). - Moving the version later is one PR: `.python-version`, both `ARG PYTHON_VERSION` lines, the lock (`scripts/lock-requirements.sh`), the image version bump, and a check of the Renovate container's python. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 1 commit 2026-11-16 07:45:10 +00:00
ci(python): one Python (3.14) for the lock, a clone and the ci image
Build / build (pull_request) Successful in 14s
Molecule / molecule (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 56s
b0607a39e2
.python-version (3.14) is the source. dev-setup.sh and lock-requirements.sh
require exactly that minor; the ci image builds /opt/venv from its baked
python-build-standalone of that version (ARG PYTHON_VERSION) instead of the
distribution's python3, and derives the python<MINOR> links for
ansible-test from it; `check_image_versions.py pins` fails when
.python-version, the lock header or an `ARG PYTHON_VERSION` differs.
The lock already carries the 3.14 header (Renovate's -full container runs
pip-compile on its own python 3.14.8); renovate.yml now says that python's
minor version must equal .python-version. ci image 0.2.25 -> 0.2.26.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
Defame1297 added 1 commit 2026-11-16 07:46:18 +00:00
Merge branch 'main' into fix/renovate-lock-python-pin
Build / build (pull_request) Successful in 13s
Molecule / molecule (pull_request) Successful in 11m24s
Lint / lint (pull_request) Successful in 39s
47922740e0
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-16 07:47:18 +00:00
Defame1297 merged commit 8239ba2bd4 into main 2026-11-16 07:58:43 +00:00
Defame1297 deleted branch fix/renovate-lock-python-pin 2026-11-16 07:58:43 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#219