diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 2770d80..0505b0c 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -13,6 +13,18 @@ echo "=== Building and Releasing from: ${REPO_DIR} ===" # ----------------------------------------------------------------------------- # 2. Environment & Tooling Setup # ----------------------------------------------------------------------------- +# Find the latest pre-installed standalone Python version in pyenv. Excludes +# 'system' because that's a stripped Debian package without 'ensurepip', and +# 'venv' requires 'ensurepip'. +PYENV_VER="$(pyenv versions --bare 2>/dev/null | awk '$1 != "system" && $1 ~ /^[0-9]/' | sort -V | tail -n 1)" +if [[ -z "${PYENV_VER}" ]]; then + echo "ERROR: No standalone Python version found in pyenv." >&2 + exit 1 +fi + +echo "=== Activating pyenv Python version: ${PYENV_VER} ===" +pyenv global "${PYENV_VER}" + # Setup virtual environment for releasing python3 -m venv .venv source ./.venv/bin/activate