Bug: Wrong detection of python version 3.10 lower than 3.5
Issue: As part of requirement checking, venvtools detected the python installed version (3.10) and compared it with the required version (3.5), and wrongly reported currently installed version is lower than the required version.
venvtools -v
venvtools: error: Required at least python-3.5! [3.10.6]
Finding: Line 173, venvtools only took the first two numbers after removing the dot for comparison, causing the issue.
pyversion=$(${VENVTOOLS_PYTHON} -V 2>&1 | awk '{ print $2 }')
pyver=${pyversion//./}
pyver=${pyver:0:2}
if (( "${pyver}" < 35 )); then
echo -e "venvtools: error: Required at least python-3.5! [${pyversion}]" >&2
EXIT_CODE=2
elif [[ $(python3 -c 'import pkgutil; print(1 if pkgutil.find_loader("venv") else 0)') == 0 ]]; then
echo -e "venvtools: error: Python module venv not found!" >&2
EXIT_CODE=2
fi