From c7078531b7a863be6bcdc64b8afce7a055e96a22 Mon Sep 17 00:00:00 2001 From: nanoric Date: Mon, 18 Mar 2019 22:44:40 -0400 Subject: [PATCH 1/7] [Fix] ctp: fixed linux .so not found error --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 53e85ea5..2a4a568f 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ vnctpmd = Extension("vnpy.api.ctp.vnctpmd", extra_compile_args=compiler_flags, extra_link_args=extra_link_args, depends=[], - runtime_library_dirs=["vnpy/api/ctp"], + runtime_library_dirs=["$ORIGIN"], language="cpp", ) vnctptd = Extension("vnpy.api.ctp.vnctptd", @@ -48,7 +48,7 @@ vnctptd = Extension("vnpy.api.ctp.vnctptd", libraries=["thostmduserapi", "thosttraderapi", ], extra_compile_args=compiler_flags, extra_link_args=extra_link_args, - runtime_library_dirs=["vnpy/api/ctp"], + runtime_library_dirs=["$ORIGIN"], depends=[], language="cpp", ) From c3f496475c5d2b29b30b1e24dad4a939065fe509 Mon Sep 17 00:00:00 2001 From: nanoric Date: Mon, 18 Mar 2019 22:45:48 -0400 Subject: [PATCH 2/7] [Fix] fixed install script --- install.bat | 2 +- install.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/install.bat b/install.bat index a13bfd8c..ba97d687 100644 --- a/install.bat +++ b/install.bat @@ -2,4 +2,4 @@ pip install -r requirements.txt :: Install vn.py -python setup.py install \ No newline at end of file +pip install . \ No newline at end of file diff --git a/install.sh b/install.sh index a13bfd8c..4f36d7f3 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,6 @@ -::Install Python Modules +#!/usr/bin/env bash +# Install Python Modules pip install -r requirements.txt -:: Install vn.py -python setup.py install \ No newline at end of file +# Install vn.py +pip install . \ No newline at end of file From 11c0b050b4a2d5a8f82ad832fe7a527abde04c8b Mon Sep 17 00:00:00 2001 From: nanoric Date: Mon, 18 Mar 2019 23:00:21 -0400 Subject: [PATCH 3/7] [Fix] fixed requirements.txt: platform_system is "Linux" but not "Unix" --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d32fd258..dd586362 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ pandas matplotlib seaborn jupyter -ta-lib; platform_system=="Unix" +ta-lib; platform_system=="Linux" From fc83a62ea04302e641b8fc0e943296568f80ecb5 Mon Sep 17 00:00:00 2001 From: nanoric Date: Tue, 19 Mar 2019 01:00:47 -0400 Subject: [PATCH 4/7] [Add] install.sh: make & install ta-lib to /usr --- install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/install.sh b/install.sh index 4f36d7f3..3ce3f578 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash + +# Get and build ta-lib +pushd /tmp +wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz +tar -xf ta-lib-0.4.0-src.tar.gz +cd ta-lib +./configure --prefix=/usr +make +sudo make install +popd + +# old versions of ta-lib imports numpy in setup.py +pip install numpy + # Install Python Modules pip install -r requirements.txt From 9f517e33b4bcda575eb9babd164d68c9c81cb246 Mon Sep 17 00:00:00 2001 From: nanoric Date: Tue, 19 Mar 2019 01:01:15 -0400 Subject: [PATCH 5/7] [Del] requirements.txt: removed jupyter --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index dd586362..26d68be9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,5 @@ numpy pandas matplotlib seaborn -jupyter ta-lib; platform_system=="Linux" From bcc110b1ae1ef2294e4aecf4c66aff2cda5b1d73 Mon Sep 17 00:00:00 2001 From: nanoric Date: Tue, 19 Mar 2019 01:41:54 -0400 Subject: [PATCH 6/7] [Fix] new travis script --- .travis.yml | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2ebf5d1..eaa0f3e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,34 @@ language: python + +dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069) + python: - - "3.6" -install: - - pip install -r requirements.txt - - pip install flake8 -script: - - python check.py + - "3.7" + +matrix: + include: + + # pip install under linux + - before_install: + # C++17 + - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + - sudo apt-get update -qq + install: + # C++17 + - sudo apt-get install -qq gcc-8 g++-8 + - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90 + - 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 + - bash ./install.sh + script: + - python -c "import vnpy.api.ctp.vnctp; import vnpy.api.oes.vnoes; exit(0);" + + + # code quality analysis + - before_install: + - pip install flake8 + install: + - "" # prevent running "pip install -r requirements.txt" + script: + - flake8 From 0ce5e15c8bcd77fda55dae1138cda72c1cc3d0eb Mon Sep 17 00:00:00 2001 From: nanoric Date: Tue, 19 Mar 2019 04:34:49 -0400 Subject: [PATCH 7/7] [Add] .travis.yml: added names for build matrix --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index eaa0f3e7..b87ea123 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,8 @@ python: matrix: include: - - # pip install under linux - - before_install: + - name: "pip install under linux" + before_install: # C++17 - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-get update -qq @@ -22,11 +21,12 @@ matrix: # Linux install script - bash ./install.sh script: + # todo: use python unittest - python -c "import vnpy.api.ctp.vnctp; import vnpy.api.oes.vnoes; exit(0);" - # code quality analysis - - before_install: + - name: "code quality analysis: flake8" + before_install: - pip install flake8 install: - "" # prevent running "pip install -r requirements.txt"