diff --git a/.travis.yml b/.travis.yml index b2c8936d..bf5bd5bf 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" @@ -23,11 +27,9 @@ 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 . - 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: @@ -41,10 +43,8 @@ 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 - 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: @@ -58,8 +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 - script: - # todo: use python unittest - - mkdir run; cd run; python -c "import vnpy.api.ctp.vnctpmd; import vnpy.api.oes.vnoes; exit(0);" - diff --git a/requirements.txt b/requirements.txt index 7af2245d..4daceb87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,21 @@ PyQt5<5.12 dataclasses; python_version<="3.6" qdarkstyle -futu-api +requests websocket-client peewee numpy pandas matplotlib seaborn -ta-lib -ibapi +futu-api +tigeropen + +# 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 +# todo: use cdn instead +https://vnpy-pip.oss-cn-shanghai.aliyuncs.com/colletion/ibapi-9.75.1-py3-none-any.whl 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() 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