fix(scripts): require Python 3.13 in dev-setup.sh
Build / build (pull_request) Successful in 10s
Lint / lint (pull_request) Successful in 17s
Molecule / molecule (pull_request) Successful in 4m49s

requirements-dev.txt pins ansible-core 2.22.0, which needs Python 3.13+.
The script still accepted 3.11+, so on a 3.11 host pip failed with an
opaque 'no matching distribution' error, and an existing 3.11 venv was
kept instead of rebuilt. Raise the guard, fix the message and comments.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
Defame1297andClaude Sonnet 5.5 committed 2026-11-10 21:36:29 +00:00
1 parent 15e0b44364
commit a0091abc14
1 file changed
+8 -6
+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