From 31da42a485396d3440ca97d9de242a3828adc115 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Jan 2019 19:50:46 +0100 Subject: [PATCH 1/6] Show error when no python is found --- setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.sh b/setup.sh index 58aabd507..11a36380c 100755 --- a/setup.sh +++ b/setup.sh @@ -17,6 +17,11 @@ function check_installed_python() { return fi + if [ -z ${PYTHON} ]; then + echo "No usable python found. Please make sure to have python3.6 or python3.7 installed" + exit 1 + fi + } function updateenv () { From 9e5e485d0a090de77200c781d9618e280357433d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Jan 2019 19:51:28 +0100 Subject: [PATCH 2/6] put --upgrade flag to the same location in subsequent requests --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 11a36380c..f2ebb7009 100755 --- a/setup.sh +++ b/setup.sh @@ -31,7 +31,7 @@ function updateenv () { source .env/bin/activate echo "pip3 install in-progress. Please wait..." pip3 install --quiet --upgrade pip - pip3 install --quiet -r requirements.txt --upgrade + pip3 install --quiet --upgrade -r requirements.txt pip3 install --quiet -r requirements.txt read -p "Do you want to install dependencies for dev [Y/N]? " From 337ebdeccb02fc75bdd4b0c92ddf02129c84afee Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Jan 2019 19:51:51 +0100 Subject: [PATCH 3/6] Avoid installing ta-lib multiple times --- setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.sh b/setup.sh index f2ebb7009..3ab013250 100755 --- a/setup.sh +++ b/setup.sh @@ -50,6 +50,11 @@ function updateenv () { # Install tab lib function install_talib () { + if [ -f /usr/local/lib/libta_lib.a ]; then + echo "ta-lib already installed, skipping" + return + fi + cd build_helpers tar zxvf ta-lib-0.4.0-src.tar.gz cd ta-lib From 01e2dc17b5c506da86373cee27aa98ac7e3bbd2d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Jan 2019 20:00:10 +0100 Subject: [PATCH 4/6] Remove whitespace in fucntion definition --- setup.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/setup.sh b/setup.sh index 3ab013250..9e969be2b 100755 --- a/setup.sh +++ b/setup.sh @@ -24,7 +24,7 @@ function check_installed_python() { } -function updateenv () { +function updateenv() { echo "-------------------------" echo "Update your virtual env" echo "-------------------------" @@ -49,7 +49,7 @@ function updateenv () { } # Install tab lib -function install_talib () { +function install_talib() { if [ -f /usr/local/lib/libta_lib.a ]; then echo "ta-lib already installed, skipping" return @@ -67,7 +67,7 @@ function install_talib () { } # Install bot MacOS -function install_macos () { +function install_macos() { if [ ! -x "$(command -v brew)" ] then echo "-------------------------" @@ -81,7 +81,7 @@ function install_macos () { } # Install bot Debian_ubuntu -function install_debian () { +function install_debian() { sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-get update sudo apt-get install python3.6 python3.6-venv python3.6-dev build-essential autoconf libtool pkg-config make wget git @@ -89,13 +89,13 @@ function install_debian () { } # Upgrade the bot -function update () { +function update() { git pull updateenv } # Reset Develop or Master branch -function reset () { +function reset() { echo "----------------------------" echo "Reset branch and virtual env" echo "----------------------------" @@ -139,7 +139,7 @@ function test_and_fix_python_on_mac() { fi } -function config_generator () { +function config_generator() { echo "Starting to generate config.json" echo @@ -185,7 +185,7 @@ function config_generator () { } -function config () { +function config() { echo "-------------------------" echo "Config file generator" @@ -211,7 +211,7 @@ function config () { echo } -function install () { +function install() { echo "-------------------------" echo "Install mandatory dependencies" echo "-------------------------" @@ -239,7 +239,7 @@ function install () { echo "You can now use the bot by executing 'source .env/bin/activate; python freqtrade/main.py'." } -function plot () { +function plot() { echo " ----------------------------------------- Install dependencies for Plotting scripts @@ -248,7 +248,7 @@ Install dependencies for Plotting scripts pip install plotly --upgrade } -function help () { +function help() { echo "usage:" echo " -i,--install Install freqtrade from scratch" echo " -u,--update Command git pull to update." From f088f43b406613ad1fd9aff7c8db1909129a7c40 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Jan 2019 20:04:54 +0100 Subject: [PATCH 5/6] Install numpy before py_find_1st --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 9e969be2b..55bd746e1 100755 --- a/setup.sh +++ b/setup.sh @@ -30,9 +30,9 @@ function updateenv() { echo "-------------------------" source .env/bin/activate echo "pip3 install in-progress. Please wait..." - pip3 install --quiet --upgrade pip + # Install numpy first to have py_find_1st install clean + pip3 install --quiet --upgrade pip numpy pip3 install --quiet --upgrade -r requirements.txt - pip3 install --quiet -r requirements.txt read -p "Do you want to install dependencies for dev [Y/N]? " if [[ $REPLY =~ ^[Yy]$ ]] From 506237e3b4973e84b7022657b441c6ba0e08d2ca Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Jan 2019 20:06:15 +0100 Subject: [PATCH 6/6] Don't use --quiet on pip install this hides errors from users and complicates debugging in case of problmes --- setup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 55bd746e1..2005f4f82 100755 --- a/setup.sh +++ b/setup.sh @@ -31,14 +31,13 @@ function updateenv() { source .env/bin/activate echo "pip3 install in-progress. Please wait..." # Install numpy first to have py_find_1st install clean - pip3 install --quiet --upgrade pip numpy - pip3 install --quiet --upgrade -r requirements.txt + pip3 install --upgrade pip numpy + pip3 install --upgrade -r requirements.txt read -p "Do you want to install dependencies for dev [Y/N]? " if [[ $REPLY =~ ^[Yy]$ ]] then - pip3 install --quiet -r requirements-dev.txt --upgrade - pip3 install --quiet -r requirements-dev.txt + pip3 install --upgrade -r requirements-dev.txt else echo "Dev dependencies ignored." fi