ci: python fallback installs python3-dev when the image's python has no headers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0caecba931
commit
287b562c47
1 file changed
+8
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user