Skip to content

Commit

Permalink
test Min TargetPythonVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
Mips2648 committed Aug 28, 2024
1 parent be1e62d commit 822ce23
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyenv.lib
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ initPython3() {
testPython3Version
}

testMinTargetPythonVersion() {
vercomp $TARGET_PYTHON_VERSION "3.9"
local EXIT_CODE=$?
if [[ $EXIT_CODE -gt 1 ]]; then
echo "You cannot install a version of python lower than 3.9"
exit 1
fi
}

installPyEnv() {
echo "** Install PyEnv **"
curl https://pyenv.run | PYENV_ROOT="${PYENV_DIR}" bash
Expand Down Expand Up @@ -104,6 +113,8 @@ installOrUpdatePyEnv() {
}

installPython3WithPyEnv() {
testMinTargetPythonVersion

availableVersion=$(PYENV_ROOT="${PYENV_DIR}" ${PYENV_DIR}/bin/pyenv latest ${TARGET_PYTHON_VERSION} 2> /dev/null)
[[ -z "$availableVersion" ]] && availableVersion="0.0.0"

Expand Down Expand Up @@ -172,6 +183,7 @@ autoSetupVenv() {
numSubStepMax=5

subStep "Init python3 & prerequisites"
tryOrStop testMinTargetPythonVersion
tryOrStop initPython3

subStep "Init pyEnv"
Expand Down

0 comments on commit 822ce23

Please sign in to comment.