fix(scripts): require Python 3.13 in dev-setup.sh #81

Merged
Defame1297 merged 1 commits from fix/dev-setup-python-version into main 2026-11-10 21:52:22 +00:00
+8 -6
View File
@@ -2,10 +2,10 @@
# Sets up a local checkout for development: a virtualenv with the pinned tools
# (requirements-dev.txt, the versions CI runs) and git hooks that find them.
#
# scripts/dev-setup.sh # KAMINO_PYTHON=python3.12 scripts/dev-setup.sh to pick one
# scripts/dev-setup.sh # KAMINO_PYTHON=python3.13 scripts/dev-setup.sh to pick one
#
# KAMINO_PYTHON (default python3) selects the interpreter that is checked and that creates
# a new virtualenv. An existing virtualenv is kept when it already runs Python 3.11+, even
# a new virtualenv. An existing virtualenv is kept when it already runs Python 3.13+, even
# if it was built by another interpreter; only an older one is rebuilt.
#
# The repository is the one this script lives in, whatever the caller's working directory.
@@ -20,12 +20,14 @@
# again after changing requirements-dev.txt or the hook types.
set -euo pipefail
# ansible-core 2.19 (requirements-dev.txt) needs Python 3.11+. The ci image uses the
# distribution's 3.12; any 3.11+ gives the same pins.
# ansible-core 2.22 (requirements-dev.txt) needs Python 3.13+. Renovate raises that pin, so
# when a bump of it changes the minimum Python, raise py_ok and the message below in the
# same pull request. The ci image has python3.13 next to the distribution's;
# without a system 3.13, `uv python install 3.13` provides one.
python="${KAMINO_PYTHON:-python3}"
py_ok='import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)'
py_ok='import sys; sys.exit(0 if sys.version_info >= (3, 13) else 1)'
if ! "$python" -c "$py_ok" 2>/dev/null; then
echo "error: $python is missing or older than 3.11 (ansible-core 2.19 needs 3.11+); set KAMINO_PYTHON=/path/to/python3.12" >&2
echo "error: $python is missing or older than 3.13 (ansible-core 2.22 needs 3.13+); set KAMINO_PYTHON=/path/to/python3.13 (uv python install 3.13)" >&2
exit 1
fi