fix(ci): avoid uv-managed python bootstrap on runners
This commit is contained in:
27
scripts/ensure-ci-python.sh
Executable file
27
scripts/ensure-ci-python.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TARGET_VERSION="${1:-3.11}"
|
||||
IFS="." read -r PYTHON_MAJOR PYTHON_MINOR _ <<< "${TARGET_VERSION}"
|
||||
|
||||
if [[ -n "${PYTHON_MINOR:-}" ]]; then
|
||||
PYTHON_BIN="python${PYTHON_MAJOR}.${PYTHON_MINOR}"
|
||||
else
|
||||
PYTHON_BIN="python${PYTHON_MAJOR}"
|
||||
fi
|
||||
|
||||
if command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
|
||||
command -v "${PYTHON_BIN}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get update
|
||||
apt-get install -y software-properties-common
|
||||
add-apt-repository -y ppa:deadsnakes/ppa
|
||||
apt-get update
|
||||
apt-get install -y "${PYTHON_BIN}" "${PYTHON_BIN}-venv"
|
||||
|
||||
command -v "${PYTHON_BIN}"
|
||||
Reference in New Issue
Block a user