Skip to content

fix(ci): use the intended Python interpreter for CMake discovery#6105

Merged
henryiii merged 3 commits into
pybind:masterfrom
henryiii:henryiii/fix/ci-freethreaded
Jul 24, 2026
Merged

fix(ci): use the intended Python interpreter for CMake discovery#6105
henryiii merged 3 commits into
pybind:masterfrom
henryiii:henryiii/fix/ci-freethreaded

Conversation

@henryiii

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Description

CI has been red since the manylinux/musllinux images added Python 3.15 and dropped 3.13t, and the same runner refresh broke the free-threaded jobs on macOS and Windows:

  • In the manylinux jobs, uv creates the requested venv, but Python_ROOT_DIR is only a hint: FindPython's version scan tries 3.15 first and finds /usr/local/bin/python3.15 on PATH before considering the venv's older interpreter. All four jobs then built against 3.15 and failed at the pytest step (No module named pytest).
  • In the standard macOS/Windows 3.14t jobs, FindPython picked a system GIL 3.14 (e.g. Homebrew's framework build) instead of setup-python's free-threaded interpreter.

Fixes:

  • CMakeLists.txt: when the venv machinery sets Python_ROOT_DIR, also pin Python_EXECUTABLE to the venv's interpreter, making discovery exact instead of heuristic.
  • reusable-standard.yml: pass setup-python's interpreter to CMake as -DPYTHON_EXECUTABLE (works in both old and new FindPython modes).
  • ci.yml: drop the 3.13t manylinux rows; the images no longer ship 3.13t, and 3.14t rows already exist.

Suggested changelog entry:

henryiii added 2 commits July 23, 2026 01:47
The manylinux/musllinux images added Python 3.15 and dropped 3.13t;
FindPython's version scan then picked /usr/local/bin/python3.15 over
the uv-created venv (Python_ROOT_DIR is only a hint). Similarly, the
macOS and Windows 3.14t jobs picked a system 3.14 over setup-python's
free-threaded interpreter. Pin the interpreter explicitly in both
places, and drop the 3.13t manylinux jobs.

Assisted-by: ClaudeCode:claude-fable-5
@rwgk

rwgk commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

@rwgk rwgk 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.

Suggested revised title:

fix(ci): use the intended Python interpreter for CMake discovery

All suggestions aim to avoid using the term "pin", it doesn't seem quite fitting.

Thanks for taking care of this!

Comment thread .github/workflows/reusable-standard.yml Outdated
Comment thread CMakeLists.txt Outdated
@henryiii henryiii changed the title fix(ci): pin Python discovery to the intended interpreter fix(ci): use the intended Python interpreter for CMake discovery Jul 24, 2026
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>
@henryiii
henryiii merged commit 85198b5 into pybind:master Jul 24, 2026
145 of 146 checks passed
@henryiii
henryiii deleted the henryiii/fix/ci-freethreaded branch July 24, 2026 14:45
@github-actions github-actions Bot added the needs changelog Possibly needs a changelog entry label Jul 24, 2026
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Jul 25, 2026
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