DEBUG="n"
QUIET='n'
-VERSION="2.2"
+VERSION="2.3"
# console colors:
RED=""
cd "${BASE_DIR}"
BASE_DIR=$( readlink -f . )
+declare -a VALID_PY_VERSIONS=("3.10" "3.9" "3.8" "3.7" "3.6")
+
PIP_OPTIONS=
export VIRTUAL_ENV_DISABLE_PROMPT=y
exit 1
fi
- if type -t virtualenv >/dev/null ; then
- :
- else
- error "Command '${RED}virtualenv${NORMAL}' not found, please install package '${YELLOW}python-virtualenv${NORMAL}' or appropriate."
- exit 6
- fi
-
if type -t msgfmt >/dev/null ; then
:
else
#------------------------------------------------------------------------------
init_venv() {
- local -a valid_py_versions=("3.8" "3.7" "3.6" "3.5")
local py_version=
local python=
local found="n"
if [[ ! -f venv/bin/activate ]] ; then
found="n"
- for py_version in "${valid_py_versions[@]}" ; do
+ for py_version in "${VALID_PY_VERSIONS[@]}" ; do
python="python${py_version}"
debug "Testing Python binary '${CYAN}${python}${NORMAL}' …"
if type -t "${python}" >/dev/null ; then
empty_line
info "Found '${GREEN}${python}${NORMAL}'."
empty_line
- virtualenv --python="${python}" venv
+ "${python}" -m venv venv
break
fi
done
if [[ "${found}" == "n" ]] ; then
empty_line >&2
error "Did not found a usable Python version." >&2
- error "Usable Python versions are: ${YELLOW}${valid_py_versions[*]}${NORMAL}." >&2
+ error "Usable Python versions are: ${YELLOW}${VALID_PY_VERSIONS[*]}${NORMAL}." >&2
empty_line >&2
exit 5
fi