From 9dbc82cacd8edbbd17fc9c4ef3dcfa6d27b79c42 Mon Sep 17 00:00:00 2001 From: Zeshi Wu Date: Tue, 23 Jun 2026 16:36:43 +0800 Subject: [PATCH] Select Python 3.11+ interpreter in install-dev.sh The bare `python3` may resolve to an older interpreter (e.g. 3.9) that silently picks up incompatible dependency versions. Probe for a 3.11+ interpreter, fail with a clear message if none is found, and upgrade pip in the fresh venv so newer wheel metadata resolves correctly. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/install-dev.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/scripts/install-dev.sh b/scripts/install-dev.sh index c4359f63..cff957e8 100755 --- a/scripts/install-dev.sh +++ b/scripts/install-dev.sh @@ -4,6 +4,27 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$ROOT_DIR" -python3 -m venv .venv +# skill-manager requires Python 3.11+. The bare `python3` on a machine may be +# older (e.g. 3.9), which silently resolves incompatible dependency versions, +# so pick the first interpreter that satisfies the minimum. +find_python() { + for candidate in python3.14 python3.13 python3.12 python3.11 python3; do + if command -v "$candidate" >/dev/null 2>&1 \ + && "$candidate" -c 'import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)'; then + echo "$candidate" + return 0 + fi + done + return 1 +} + +PYTHON="$(find_python)" || { + echo "error: Python 3.11+ is required but was not found on PATH." >&2 + exit 1 +} +echo "Using $("$PYTHON" --version) ($PYTHON)" + +"$PYTHON" -m venv .venv +"$ROOT_DIR/.venv/bin/python" -m pip install --upgrade pip "$ROOT_DIR/.venv/bin/pip" install -r requirements.txt npm install