vnpy/.travis.yml

138 lines
5.0 KiB
YAML
Raw Normal View History

2019-01-07 06:20:39 +00:00
language: python
2019-03-19 05:41:54 +00:00
cache: pip
2019-03-19 05:41:54 +00:00
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
2019-01-07 06:20:39 +00:00
python:
2019-03-19 05:41:54 +00:00
- "3.7"
services:
- mongodb
- mysql
- postgresql
2019-03-19 05:41:54 +00:00
before_script:
- mysql -e 'CREATE DATABASE vnpy;'
- psql -c 'create database vnpy;' -U postgres
script:
# todo: use python unittest
2019-04-14 09:58:18 +00:00
- pip install psycopg2 mongoengine pymysql # we should support all database in test environment
- cd tests; source travis_env.sh; python test_all.py
2019-03-19 05:41:54 +00:00
matrix:
include:
2019-03-19 10:38:24 +00:00
- name: "code quality analysis: flake8"
2019-04-14 10:07:20 +00:00
services: [] # service is not need
2019-04-14 10:42:16 +00:00
before_script: []
2019-03-19 10:38:24 +00:00
before_install:
- pip install flake8
install:
- "" # prevent running "pip install -r requirements.txt"
script:
- flake8
2019-03-19 11:31:28 +00:00
- name: "pip install under Windows"
os: "windows"
2019-04-14 10:07:20 +00:00
services: [] # service is unavailable under windows
2019-03-29 10:13:38 +00:00
# language : cpp is necessary for windows
2019-03-19 11:31:28 +00:00
language: "cpp"
env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
before_install:
2019-04-14 10:42:16 +00:00
- choco install -yf mysql mongodb
2019-04-14 11:08:55 +00:00
- choco install -yf postgresql10 --params '/Password:'
2019-04-14 10:42:16 +00:00
- choco install -yf python3 --version 3.7.2
2019-03-19 11:31:28 +00:00
install:
- python -m pip install --upgrade pip wheel setuptools
2019-04-03 06:46:43 +00:00
- pip install https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
2019-03-19 11:31:28 +00:00
- pip install -r requirements.txt
- pip install .
2019-03-19 10:38:24 +00:00
- name: "pip install under Ubuntu: gcc-8"
before_install:
2019-03-19 05:41:54 +00:00
# C++17
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -y
2019-03-19 05:41:54 +00:00
install:
# C++17
- sudo apt-get install -y gcc-8 g++-8
2019-03-19 05:41:54 +00:00
- 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
2019-04-03 06:46:43 +00:00
# update pip & setuptools
- python -m pip install --upgrade pip wheel setuptools
2019-04-03 06:46:43 +00:00
# Linux install script
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
2019-03-19 05:41:54 +00:00
- bash ./install.sh
2019-03-19 10:38:24 +00:00
- name: "pip install under Ubuntu: gcc-7"
before_install:
2019-03-19 10:38:24 +00:00
# C++17
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -y
2019-03-19 05:41:54 +00:00
install:
2019-03-19 10:38:24 +00:00
# C++17
- sudo apt-get install -y gcc-7 g++-7
2019-03-19 10:38:24 +00:00
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
- 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
2019-04-03 06:46:43 +00:00
# update pip & setuptools
2019-03-28 05:58:50 +00:00
- python -m pip install --upgrade pip wheel setuptools
2019-04-03 06:46:43 +00:00
# Linux install script
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
2019-03-19 10:38:24 +00:00
- bash ./install.sh
2019-04-14 10:10:53 +00:00
- name: "pip install under osx"
language: shell # osx supports only shell
install:
2019-04-14 15:10:26 +00:00
- python3 -m pip install --upgrade pip wheel setuptools --user python
- pip3 install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
- bash ./install.sh python3 pip3
2019-04-14 10:10:53 +00:00
- name: "sdist install under Windows"
os: "windows"
2019-04-14 15:06:21 +00:00
services: [] # service is not need
before_script: []
2019-03-29 10:13:38 +00:00
# language : cpp is necessary for windows
language: "cpp"
env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
before_install:
2019-04-14 15:06:21 +00:00
- choco install -yf mysql mongodb
- choco install -yf postgresql10 --params '/Password:'
- choco install -yf python3 --version 3.7.2
install:
- python -m pip install --upgrade pip wheel setuptools
- python setup.py sdist
- pip install https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
- pip install dist/`ls dist`
2019-03-29 06:53:28 +00:00
- name: "sdist install under Ubuntu: gcc-8"
before_install:
# C++17
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -y
install:
# C++17
- sudo apt-get install -y 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
- python -m pip install --upgrade pip wheel setuptools
2019-03-29 06:49:18 +00:00
- 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
2019-03-29 08:06:25 +00:00
- pip install numpy
2019-03-29 10:13:38 +00:00
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
- python setup.py sdist
- pip install dist/`ls dist`