From 6a7a7317f22b5b7b46c5c44138f4046064461ee8 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Mon, 17 Jul 2023 16:55:41 +0200 Subject: [PATCH] feat(tools): use ESP_PYTHON during install Currently ESP_PYTHON is used in the install.sh script, but it's overwritten in detect_python.sh. This allows to explicitly specify python binary, which should be used to create venv. $ ESP_PYTHON=/usr/bin/python3.7 ./install.{sh,fish} $ ESP_PYTHON=/usr/bin/python3.7 ./export.{sh,fish} Signed-off-by: Frantisek Hrbata --- tools/detect_python.fish | 5 +++-- tools/detect_python.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/detect_python.fish b/tools/detect_python.fish index bb72445c1d..c89c16a2ec 100644 --- a/tools/detect_python.fish +++ b/tools/detect_python.fish @@ -5,9 +5,10 @@ set OLDEST_PYTHON_SUPPORTED_MAJOR 3 set OLDEST_PYTHON_SUPPORTED_MINOR 7 -set -x ESP_PYTHON python +set -q ESP_PYTHON; or set PYLIST python3 python python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 +set -q ESP_PYTHON; or set -x ESP_PYTHON python -for p_cmd in python3 python python3.7 python3.8 python3.9 python3.10 python3.11 python3.12; +for p_cmd in $PYLIST; $p_cmd --version >/dev/null 2>&1; or continue echo "Checking \"$p_cmd\" ..." diff --git a/tools/detect_python.sh b/tools/detect_python.sh index ffedd6065d..18436b51d0 100644 --- a/tools/detect_python.sh +++ b/tools/detect_python.sh @@ -10,9 +10,10 @@ OLDEST_PYTHON_SUPPORTED_MAJOR=3 OLDEST_PYTHON_SUPPORTED_MINOR=7 -ESP_PYTHON=python +PYLIST=${ESP_PYTHON:-python3 python python3.7 python3.8 python3.9 python3.10 python3.11 python3.12} +ESP_PYTHON=${ESP_PYTHON:-python} -for p_cmd in python3 python python3.7 python3.8 python3.9 python3.10 python3.11 python3.12; do +for p_cmd in $PYLIST; do $p_cmd --version >/dev/null 2>&1 || continue echo "Checking \"$p_cmd\" ..."