Skip to content

Commit 51ed1f3

Browse files
bluetclaude
andcommitted
fix(ci): pair setup-python with setup-uv to get latest Python patch
CI failure on PR #230 commit 1558779: build (3.12) failed because the runner used Python 3.12.3 (pre-installed on ubuntu-latest), not 3.12.11+. Two tests assert RFC 5952 IPv4-mapped IPv6 string format (`::ffff:192.0.2.1`), which Python only adopted in 3.12.4 (bpo-119891). Root cause: setup-uv's `python-version: "3.12"` doesn't install the LATEST 3.12 patch — it picks up whatever Python is already on PATH (the runner's older pre-installed version). Fix: install Python via `actions/setup-python` first (always picks the latest patch for the requested minor), then run setup-uv WITHOUT the `python-version` input. Pass `--python ${{ matrix.python-version }}` to `uv sync` to pin uv to the version setup-python provided. Same fix applied to py-to-exe.yml for consistency. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1558779 commit 51ed1f3

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/py-to-exe.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@ jobs:
1919
python-version: ["3.14"] # Default to current Python; revert to 3.13 if PyInstaller breaks
2020
steps:
2121
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22-
- name: Install uv and set the Python version
22+
# See python-test-versions.yml for why setup-python is paired with
23+
# setup-uv — TL;DR: avoid the runner's older pre-installed Python.
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install uv
2329
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2430
with:
2531
version: "0.11.13"
26-
python-version: ${{ matrix.python-version }}
2732
enable-cache: true
2833
- name: Install project + pyinstaller
2934
# pyinstaller is build-only tooling, not a project runtime dep, so
3035
# install it on top of the locked env via `uv pip install` rather
3136
# than adding it to pyproject.toml.
3237
run: |
33-
uv sync --locked
38+
uv sync --locked --python ${{ matrix.python-version }}
3439
uv pip install pyinstaller
3540
- name: Compile python to exe
3641
run: |

.github/workflows/python-test-versions.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,25 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22-
- name: Install uv and set the Python version
22+
# Install Python via setup-python to get the LATEST patch of the
23+
# requested minor version. setup-uv's `python-version` input would
24+
# otherwise pick up the runner's pre-installed Python (often older,
25+
# e.g. 3.12.3 on ubuntu-latest as of May 2026), which breaks tests
26+
# sensitive to bug fixes shipped in later patches (e.g. Python
27+
# 3.12.4's IPv4-mapped IPv6 string format change in bpo-119891).
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install uv
2333
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2434
with:
2535
version: "0.11.13"
26-
python-version: ${{ matrix.python-version }}
2736
enable-cache: true
2837
- name: Install project + dev dependencies (includes ruff)
29-
run: uv sync --locked --dev
38+
# `--python` pins uv to the python set up above (otherwise uv may
39+
# resolve to a uv-managed install of a different patch).
40+
run: uv sync --locked --dev --python ${{ matrix.python-version }}
3041
- name: Lint with ruff
3142
run: |
3243
# stop the build if there are Python syntax errors or undefined names

0 commit comments

Comments
 (0)