From 2e23f30f635d8a82dce3e2191965308c889f9429 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 27 Mar 2019 04:12:05 -0400 Subject: [PATCH 1/9] [Add] added wheels from oss --- requirements.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 26d68be9..336153e6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,11 @@ numpy pandas matplotlib seaborn -ta-lib; platform_system=="Linux" + +# ta-lib +ta-lib; platform_system=="Linux" +https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl; platform_system=="Windows" + +# ibapi +https://pip.vnpy.com/colletion/ibapi-9.75.1-py3-none-any.whl; From 11f5db1b7764c2d9cabf8613a3e991ec9b3f20aa Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 27 Mar 2019 04:17:33 -0400 Subject: [PATCH 2/9] [Add] added a test to check if all module can be import without error. --- tests/load_all.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/load_all.py diff --git a/tests/load_all.py b/tests/load_all.py new file mode 100644 index 00000000..feae9c12 --- /dev/null +++ b/tests/load_all.py @@ -0,0 +1,26 @@ +# flake8: noqa +import unittest + + +class ImportTest(unittest.TestCase): + + # noinspection PyUnresolvedReferences + def test_import_all(self): + from vnpy.event import EventEngine + + from vnpy.trader.engine import MainEngine + from vnpy.trader.ui import MainWindow, create_qapp + + from vnpy.gateway.bitmex import BitmexGateway + from vnpy.gateway.futu import FutuGateway + from vnpy.gateway.ib import IbGateway + from vnpy.gateway.ctp import CtpGateway + from vnpy.gateway.tiger import TigerGateway + from vnpy.gateway.oes import OesGateway + + from vnpy.app.cta_strategy import CtaStrategyApp + from vnpy.app.csv_loader import CsvLoaderApp + + +if __name__ == '__main__': + unittest.main() From c9f303bcc5f205130b309b3dcd60b6ba72b64a49 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 27 Mar 2019 04:17:51 -0400 Subject: [PATCH 3/9] [Mod] make flake8 happy --- vnpy/app/cta_strategy/ui/widget.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/vnpy/app/cta_strategy/ui/widget.py b/vnpy/app/cta_strategy/ui/widget.py index e2511b9e..e4f2df1e 100644 --- a/vnpy/app/cta_strategy/ui/widget.py +++ b/vnpy/app/cta_strategy/ui/widget.py @@ -1,5 +1,3 @@ -from typing import Any - from vnpy.event import Event, EventEngine from vnpy.trader.engine import MainEngine from vnpy.trader.ui import QtCore, QtGui, QtWidgets From 8ff166a315678791ecac720a54a5e9fa12c9d185 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 27 Mar 2019 04:21:25 -0400 Subject: [PATCH 4/9] [New] travis-ci: use unittest to check if all module were built successfully. --- .travis.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2c8936d..9386cf9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,10 @@ dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069) python: - "3.7" +script: + # todo: use python unittest + - mkdir run; cd run; python ../tests/load_all.py + matrix: include: - name: "code quality analysis: flake8" @@ -25,9 +29,6 @@ matrix: install: - pip install -r requirements.txt - pip install . - script: - # todo: use python unittest - - mkdir run; cd run; python -c "import vnpy.api.ctp.vnctpmd; import vnpy.api.oes.vnoes; exit(0);" - name: "pip install under Ubuntu: gcc-8" before_install: @@ -42,9 +43,6 @@ matrix: - sudo update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-8 90 # Linux install script - bash ./install.sh - script: - # todo: use python unittest - - mkdir run; cd run; python -c "import vnpy.api.ctp.vnctpmd; import vnpy.api.oes.vnoes; exit(0);" - name: "pip install under Ubuntu: gcc-7" before_install: @@ -59,7 +57,3 @@ matrix: - sudo update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-7 90 # Linux install script - bash ./install.sh - script: - # todo: use python unittest - - mkdir run; cd run; python -c "import vnpy.api.ctp.vnctpmd; import vnpy.api.oes.vnoes; exit(0);" - From a5aa1fb338fbbdf822f599051520e7de5bfd39c2 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 27 Mar 2019 05:24:28 -0400 Subject: [PATCH 5/9] [Add] travis-ci: update setuptools before pip install --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9386cf9f..db3e011b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ matrix: before_install: - choco install python3 --version 3.7.2 install: + - python -m pip install --upgrade pip wheel setuptools - pip install -r requirements.txt - pip install . @@ -42,6 +43,7 @@ matrix: - sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-8 90 - sudo update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-8 90 # Linux install script + - python -m pip install --upgrade pip wheel setuptools - bash ./install.sh - name: "pip install under Ubuntu: gcc-7" From 72d2a0f3f12c6093407520026dc7c23594b88b87 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 27 Mar 2019 06:07:30 -0400 Subject: [PATCH 6/9] [Add] requirements.txt: added requests --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 336153e6..8180d54d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ PyQt5<5.12 dataclasses; python_version<="3.6" qdarkstyle futu-api +requests websocket-client peewee numpy From 80eda79efd8ae59bdee0265b81c6a8aedd17a4f8 Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 28 Mar 2019 01:56:46 -0400 Subject: [PATCH 7/9] [Mod] use oss instead of cdn --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8180d54d..a2820098 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,5 +15,6 @@ ta-lib; platform_system=="Linux" https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl; platform_system=="Windows" # ibapi -https://pip.vnpy.com/colletion/ibapi-9.75.1-py3-none-any.whl; +# todo: use cdn instead +https://vnpy-pip.oss-cn-shanghai.aliyuncs.com/colletion/ibapi-9.75.1-py3-none-any.whl From 7f12d6520fdf64aa6123d3522f8ece5debc3c3e8 Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 28 Mar 2019 01:58:50 -0400 Subject: [PATCH 8/9] [Add] update setuptools for gcc-7 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index db3e011b..bf5bd5bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,4 +58,5 @@ matrix: - sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-7 90 - sudo update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-7 90 # Linux install script + - python -m pip install --upgrade pip wheel setuptools - bash ./install.sh From ed0ecca9427cb87ca9d59ec5bb73ffa62c422591 Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 28 Mar 2019 02:21:54 -0400 Subject: [PATCH 9/9] [Add] requirements.txt added tigeropen --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a2820098..4daceb87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ PyQt5<5.12 dataclasses; python_version<="3.6" qdarkstyle -futu-api requests websocket-client peewee @@ -9,6 +8,8 @@ numpy pandas matplotlib seaborn +futu-api +tigeropen # ta-lib ta-lib; platform_system=="Linux"