Add python version option to dev_setup.sh (#1952)
-p arg or --python arg allows the user to select which installed python version is used in the mycroft virtualenv.pull/1975/head
parent
a94019a8b8
commit
2c858fba48
27
dev_setup.sh
27
dev_setup.sh
|
@ -27,11 +27,12 @@ Usage: dev_setup.sh [options]
|
||||||
Prepare your environment for running the mycroft-core services.
|
Prepare your environment for running the mycroft-core services.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help Show this message
|
-h, --help Show this message
|
||||||
-fm Force mimic build
|
-fm Force mimic build
|
||||||
-n, --no-error Do not exit on error (use with caution)
|
-n, --no-error Do not exit on error (use with caution)
|
||||||
-r, --allow-root Allow to be run as root (e.g. sudo)
|
-p arg, --python arg Sets the python version to use
|
||||||
-sm Skip mimic build
|
-r, --allow-root Allow to be run as root (e.g. sudo)
|
||||||
|
-sm Skip mimic build
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +40,18 @@ Options:
|
||||||
opt_forcemimicbuild=false
|
opt_forcemimicbuild=false
|
||||||
opt_allowroot=false
|
opt_allowroot=false
|
||||||
opt_skipmimicbuild=false
|
opt_skipmimicbuild=false
|
||||||
|
opt_python=python3
|
||||||
|
param=""
|
||||||
|
|
||||||
for var in "$@" ; do
|
for var in "$@" ; do
|
||||||
|
# Check if parameter should be read
|
||||||
|
if [[ ${param} == "python" ]] ; then
|
||||||
|
opt_python=${var}
|
||||||
|
param=""
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for options
|
||||||
if [[ ${var} == "-h" ]] || [[ ${var} == "--help" ]] ; then
|
if [[ ${var} == "-h" ]] || [[ ${var} == "--help" ]] ; then
|
||||||
show_help
|
show_help
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -59,6 +71,9 @@ for var in "$@" ; do
|
||||||
if [[ ${var} == "-sm" ]] ; then
|
if [[ ${var} == "-sm" ]] ; then
|
||||||
opt_skipmimicbuild=true
|
opt_skipmimicbuild=true
|
||||||
fi
|
fi
|
||||||
|
if [[ ${var} == "-p" ]] || [[ ${var} == "--python" ]] ; then
|
||||||
|
param="python"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $(id -u) -eq 0 ] && [ "${opt_allowroot}" != true ] ; then
|
if [ $(id -u) -eq 0 ] && [ "${opt_allowroot}" != true ] ; then
|
||||||
|
@ -282,7 +297,7 @@ function install_deps() {
|
||||||
VIRTUALENV_ROOT=${VIRTUALENV_ROOT:-"${TOP}/.venv"}
|
VIRTUALENV_ROOT=${VIRTUALENV_ROOT:-"${TOP}/.venv"}
|
||||||
|
|
||||||
function install_venv() {
|
function install_venv() {
|
||||||
python3 -m venv "${VIRTUALENV_ROOT}/" --without-pip
|
${opt_python} -m venv "${VIRTUALENV_ROOT}/" --without-pip
|
||||||
# Force version of pip for reproducability, but there is nothing special
|
# Force version of pip for reproducability, but there is nothing special
|
||||||
# about this version. Update whenever a new version is released and
|
# about this version. Update whenever a new version is released and
|
||||||
# verified functional.
|
# verified functional.
|
||||||
|
|
Loading…
Reference in New Issue