diff --git a/.github/actions/setup-build-environment/action.yml b/.github/actions/setup-build-environment/action.yml index fc640f3d..dbacae21 100644 --- a/.github/actions/setup-build-environment/action.yml +++ b/.github/actions/setup-build-environment/action.yml @@ -32,6 +32,14 @@ runs: apt-get install -y -qq python3 python3-venv python3 -m venv --clear "$venv" fi + # The image's python is often newer than the wheels on PyPI (detools + # 0.53.0 has none for 3.14): pip then builds from source and needs the + # headers, which the image does not ship. + inc="$("$venv/bin/python" -c 'import sysconfig; print(sysconfig.get_paths()["include"])')" + if [ ! -e "$inc/Python.h" ]; then + apt-get update -qq + apt-get install -y -qq python3-dev + fi echo "$venv/bin" >>"$GITHUB_PATH" "$venv/bin/python" --version