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

* fix(ci): pin the discovered Python to the venv/setup-python interpreter

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

* ci: use setup-python's python-path output instead of a locate step

Assisted-by: ClaudeCode:claude-fable-5

* Apply suggestions from code review

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>

---------

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>
This commit is contained in:
Henry Schreiner
2026-07-24 10:45:22 -04:00
committed by GitHub
co-authored by Ralf W. Grosse-Kunstleve
parent 7478df9420
commit 85198b598f
3 changed files with 16 additions and 4 deletions
-4
View File
@@ -240,10 +240,6 @@ jobs:
fail-fast: false
matrix:
include:
- container: quay.io/pypa/manylinux_2_28_x86_64:latest
python-version: '3.13t'
- container: quay.io/pypa/musllinux_1_2_x86_64:latest
python-version: '3.13t'
- container: quay.io/pypa/manylinux_2_28_x86_64:latest
python-version: '3.14t'
- container: quay.io/pypa/musllinux_1_2_x86_64:latest
+5
View File
@@ -34,6 +34,7 @@ jobs:
- uses: actions/checkout@v7
- name: Setup Python ${{ inputs.python-version }}
id: python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
@@ -67,6 +68,9 @@ jobs:
if: runner.os != 'Windows'
run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
# Pass setup-python's resolved interpreter path to CMake so FindPython
# does not select a different interpreter (e.g. Homebrew's 3.14 instead
# of setup-python's 3.14t).
- name: Configure
run: >
cmake -S. -Bbuild -Werror=dev
@@ -74,6 +78,7 @@ jobs:
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPYTHON_EXECUTABLE=${{ steps.python.outputs.python-path }}
${{ inputs.cmake-args }}
- name: Build