Skip to content

Commit 6838342

Browse files
author
Vasileios Karakasis
authored
Merge pull request #1762 from teojgo/bugfix/bootstrap_python_version
[bugfix] Add Python version check to bootstrap script
2 parents 486a72f + 9dddfba commit 6838342

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bootstrap.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ done
5959

6060
pyver=$($python -V | sed -n 's/Python \([0-9]\+\)\.\([0-9]\+\)\..*/\1.\2/p')
6161

62+
# We need to exit with a zero code if the Python version is the correct
63+
# one, so we invert the comparison
64+
65+
if $python -c 'import sys; sys.exit(sys.version_info[:2] >= (3, 6))'; then
66+
echo -e "ReFrame requires Python >= 3.6 (found $($python -V 2>&1))"
67+
exit 1
68+
fi
69+
6270
# Check if ensurepip is installed
6371
$python -m ensurepip --version &> /dev/null
6472

@@ -68,7 +76,7 @@ if [ $? -eq 0 ]; then
6876
fi
6977

7078
# ensurepip installs pip in `external/usr/` whereas the --target option installs
71-
# everything under `external/`. That's why include both in the PYTHONPATH
79+
# everything under `external/`. That's why we include both in the PYTHONPATH
7280

7381
export PATH=$(pwd)/external/usr/bin:$PATH
7482
export PYTHONPATH=$(pwd)/external:$(pwd)/external/usr/lib/python$pyver/site-packages:$PYTHONPATH

0 commit comments

Comments
 (0)