From 4383086e86dc67486f06c6d07335d028b583cf65 Mon Sep 17 00:00:00 2001 From: Josh Radcliff Date: Fri, 7 Aug 2026 13:31:09 -0400 Subject: [PATCH] chore(release): use non-system pyenv Without this change, attempts to use 'venv' fail because the system Python installation doesn't include 'ensurepip' Change-Id: Ic981fe11527a2f7783e2ba36fed0ac2a74d83997 --- .kokoro/release.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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