setup.sh script shall fail if venv initialization fails

This commit is contained in:
Matthias 2019-08-07 21:03:03 +02:00
parent 3d3b0938e5
commit 7d02580a2b
1 changed files with 7 additions and 5 deletions

View File

@ -39,15 +39,13 @@ function updateenv() {
echo "-------------------------" echo "-------------------------"
source .env/bin/activate source .env/bin/activate
echo "pip install in-progress. Please wait..." echo "pip install in-progress. Please wait..."
# Install numpy first to have py_find_1st install clean ${PYTHON} -m pip install --upgrade pip
${PYTHON} -m pip install --upgrade pip numpy
${PYTHON} -m pip install --upgrade -r requirements.txt
read -p "Do you want to install dependencies for dev [y/N]? " read -p "Do you want to install dependencies for dev [y/N]? "
if [[ $REPLY =~ ^[Yy]$ ]] if [[ $REPLY =~ ^[Yy]$ ]]
then then
${PYTHON} -m pip install --upgrade -r requirements-dev.txt ${PYTHON} -m pip install --upgrade -r requirements-dev.txt
else else
${PYTHON} -m pip install --upgrade -r requirements.txt
echo "Dev dependencies ignored." echo "Dev dependencies ignored."
fi fi
@ -90,7 +88,7 @@ function install_macos() {
# Install bot Debian_ubuntu # Install bot Debian_ubuntu
function install_debian() { function install_debian() {
sudo apt-get update sudo apt-get update
sudo apt-get install build-essential autoconf libtool pkg-config make wget git sudo apt-get install -y build-essential autoconf libtool pkg-config make wget git
install_talib install_talib
} }
@ -129,6 +127,10 @@ function reset() {
echo echo
${PYTHON} -m venv .env ${PYTHON} -m venv .env
if [ $? -ne 0 ]; then
echo "Could not create virtual environment. Leaving now"
exit 1
fi
updateenv updateenv
} }