From bf2a39b76da9d0c0ff99e7efdc79257f79d6ffa6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 26 Apr 2019 19:50:18 +0200 Subject: [PATCH 1/4] Fix add requirements-pi.txt in dockerfile earlier Avoids docker-build failure --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e36766530..202989e43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN cd /tmp && /tmp/install_ta-lib.sh && rm -r /tmp/*ta-lib* ENV LD_LIBRARY_PATH /usr/local/lib # Install dependencies -COPY requirements.txt /freqtrade/ +COPY requirements.txt requirements-pi.txt /freqtrade/ RUN pip install numpy --no-cache-dir \ && pip install -r requirements.txt --no-cache-dir From 99b08fbd13efef4645045556f2e33e143cada380 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 26 Apr 2019 19:51:24 +0200 Subject: [PATCH 2/4] Remove unused Hyperopt test lines --- freqtrade/tests/optimize/test_hyperopt.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/freqtrade/tests/optimize/test_hyperopt.py b/freqtrade/tests/optimize/test_hyperopt.py index 063d0e791..a777f93a8 100644 --- a/freqtrade/tests/optimize/test_hyperopt.py +++ b/freqtrade/tests/optimize/test_hyperopt.py @@ -1,7 +1,7 @@ # pragma pylint: disable=missing-docstring,W0212,C0103 -from datetime import datetime import json import os +from datetime import datetime from unittest.mock import MagicMock import pandas as pd @@ -10,9 +10,10 @@ import pytest from freqtrade import DependencyException from freqtrade.data.converter import parse_ticker_dataframe from freqtrade.data.history import load_tickerdata_file -from freqtrade.optimize.hyperopt import Hyperopt, start, setup_configuration from freqtrade.optimize.default_hyperopt import DefaultHyperOpts -from freqtrade.resolvers import StrategyResolver, HyperOptResolver +from freqtrade.optimize.hyperopt import (HYPEROPT_LOCKFILE, Hyperopt, + setup_configuration, start) +from freqtrade.resolvers import HyperOptResolver from freqtrade.state import RunMode from freqtrade.tests.conftest import log_has, patch_exchange from freqtrade.tests.optimize.test_backtesting import get_args @@ -185,7 +186,6 @@ def test_start(mocker, default_conf, caplog) -> None: '--epochs', '5' ] args = get_args(args) - StrategyResolver({'strategy': 'DefaultStrategy'}) start(args) import pprint @@ -214,7 +214,6 @@ def test_start_failure(mocker, default_conf, caplog) -> None: '--epochs', '5' ] args = get_args(args) - StrategyResolver({'strategy': 'DefaultStrategy'}) with pytest.raises(DependencyException): start(args) assert log_has( @@ -224,7 +223,6 @@ def test_start_failure(mocker, default_conf, caplog) -> None: def test_loss_calculation_prefer_correct_trade_count(hyperopt) -> None: - StrategyResolver({'strategy': 'DefaultStrategy'}) correct = hyperopt.calculate_loss(1, hyperopt.target_trades, 20) over = hyperopt.calculate_loss(1, hyperopt.target_trades + 100, 20) From dc12cacd50114394950d195d0ab33b6785c6c507 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 26 Apr 2019 19:57:09 +0200 Subject: [PATCH 3/4] Rename requirements-pi to requirements.common --- .pyup.yml | 2 +- Dockerfile | 2 +- Dockerfile.pi | 4 ++-- docs/installation.md | 2 +- requirements-pi.txt => requirements-common.txt | 0 requirements.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename requirements-pi.txt => requirements-common.txt (100%) diff --git a/.pyup.yml b/.pyup.yml index 462ae5783..3494a3fd3 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -22,7 +22,7 @@ requirements: - requirements.txt - requirements-dev.txt - requirements-plot.txt - - requirements-pi.txt + - requirements-common.txt # configure the branch prefix the bot is using diff --git a/Dockerfile b/Dockerfile index 202989e43..7a0298719 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN cd /tmp && /tmp/install_ta-lib.sh && rm -r /tmp/*ta-lib* ENV LD_LIBRARY_PATH /usr/local/lib # Install dependencies -COPY requirements.txt requirements-pi.txt /freqtrade/ +COPY requirements.txt requirements-common.txt /freqtrade/ RUN pip install numpy --no-cache-dir \ && pip install -r requirements.txt --no-cache-dir diff --git a/Dockerfile.pi b/Dockerfile.pi index 5184e2d37..1b9c4c579 100644 --- a/Dockerfile.pi +++ b/Dockerfile.pi @@ -27,9 +27,9 @@ RUN wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryco && rm Berryconda3-2.0.0-Linux-armv7l.sh # Install dependencies -COPY requirements-pi.txt /freqtrade/ +COPY requirements-common.txt /freqtrade/ RUN ~/berryconda3/bin/conda install -y numpy pandas scipy \ - && ~/berryconda3/bin/pip install -r requirements-pi.txt --no-cache-dir + && ~/berryconda3/bin/pip install -r requirements-common.txt --no-cache-dir # Install and execute COPY . /freqtrade/ diff --git a/docs/installation.md b/docs/installation.md index 23a6cbd23..7060d7b39 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -326,7 +326,7 @@ conda activate freqtrade conda install scipy pandas numpy sudo apt install libffi-dev -python3 -m pip install -r requirements-pi.txt +python3 -m pip install -r requirements-common.txt python3 -m pip install -e . ``` diff --git a/requirements-pi.txt b/requirements-common.txt similarity index 100% rename from requirements-pi.txt rename to requirements-common.txt diff --git a/requirements.txt b/requirements.txt index 4c2376078..78585f8f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Load common requirements --r requirements-pi.txt +-r requirements-common.txt numpy==1.16.3 pandas==0.24.2 From 40c02073776418614e8c223bbdaf2456beccebb8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 26 Apr 2019 19:59:05 +0200 Subject: [PATCH 4/4] revert erroneous refactor --- freqtrade/tests/optimize/test_hyperopt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/freqtrade/tests/optimize/test_hyperopt.py b/freqtrade/tests/optimize/test_hyperopt.py index a777f93a8..21db63636 100644 --- a/freqtrade/tests/optimize/test_hyperopt.py +++ b/freqtrade/tests/optimize/test_hyperopt.py @@ -11,8 +11,7 @@ from freqtrade import DependencyException from freqtrade.data.converter import parse_ticker_dataframe from freqtrade.data.history import load_tickerdata_file from freqtrade.optimize.default_hyperopt import DefaultHyperOpts -from freqtrade.optimize.hyperopt import (HYPEROPT_LOCKFILE, Hyperopt, - setup_configuration, start) +from freqtrade.optimize.hyperopt import Hyperopt, setup_configuration, start from freqtrade.resolvers import HyperOptResolver from freqtrade.state import RunMode from freqtrade.tests.conftest import log_has, patch_exchange