<commit_before>language: python

cache: pip

dist: xenial  # required for Python >= 3.7 (travis-ci/travis-ci#9069)

python:
  - "3.7"
services:
  - mongodb
  - mysql
  - postgresql

before_script:
  - mysql -e 'CREATE DATABASE vnpy;'
  - psql -c 'create database vnpy;' -U postgres

script:
  # todo: use python unittest
  - pip install psycopg2 mongoengine pymysql  # we should support all database in test environment
  - cd tests; source travis_env.sh; python test_all.py

matrix:
  include:
    - name: "code quality analysis: flake8"
      services: []  # service is not need
      before_script: []
      before_install:
        - pip install flake8
      install:
        - ""  # prevent running "pip install -r requirements.txt"
      script:
        - flake8

    - name: "pip install under Windows"
      os: "windows"
      services: []  # service is unavailable under windows
      # language : cpp is necessary for windows
      language: "cpp"
      env:
        - PATH=/c/Python37:/c/Python37/Scripts:$PATH
      before_install:
        - 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
        - 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 -r requirements.txt
        - pip install .

    - name: "pip 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
        # update pip & setuptools
        - python -m pip install --upgrade pip wheel setuptools
        # Linux install script
        - pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
        - bash ./install.sh

    - name: "pip install under Ubuntu: gcc-7"
      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-7 g++-7
        - 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
        # update pip & setuptools
        - python -m pip install --upgrade pip wheel setuptools
        # Linux install script
        - pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
        - bash ./install.sh

    - name: "pip install under osx"
      language: shell  # osx supports only shell
      install:
        - 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

    - name: "sdist install under Windows"
      os: "windows"
      services: []  # service is not need
      before_script: []
      # language : cpp is necessary for windows
      language: "cpp"
      env:
        - PATH=/c/Python37:/c/Python37/Scripts:$PATH
      before_install:
        - 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`<commit_msg>[Fix] windows build<commit_after>language: python

cache: pip

dist: xenial  # required for Python >= 3.7 (travis-ci/travis-ci#9069)

python:
  - "3.7"
services:
  - mongodb
  - mysql
  - postgresql

before_script:
  - mysql -e 'CREATE DATABASE vnpy;'
  - psql -c 'create database vnpy;' -U postgres

script:
  # todo: use python unittest
  - pip install psycopg2 mongoengine pymysql  # we should support all database in test environment
  - cd tests; source travis_env.sh;
  - python test_all.py

matrix:
  include:
    - name: "code quality analysis: flake8"
      services: []  # service is not need
      before_script: []
      before_install:
        - pip install flake8
      install:
        - ""  # prevent running "pip install -r requirements.txt"
      script:
        - flake8

    - name: "pip install under Windows"
      os: "windows"
      services: []  # service is unavailable under windows
      # language : cpp is necessary for windows
      language: "cpp"
      env:
        - PATH=/c/Python37:/c/Python37/Scripts:/c/tools/mysql/current/bin:/c/Program Files/PostgreSQL/10/bin:$PATH
      before_install:
        - 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
        - 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 -r requirements.txt
        - pip install .

    - name: "pip 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
        # update pip & setuptools
        - python -m pip install --upgrade pip wheel setuptools
        # Linux install script
        - pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
        - bash ./install.sh

    - name: "pip install under Ubuntu: gcc-7"
      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-7 g++-7
        - 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
        # update pip & setuptools
        - python -m pip install --upgrade pip wheel setuptools
        # Linux install script
        - pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
        - bash ./install.sh

    - name: "pip install under osx"
      language: shell  # osx supports only shell
      install:
        - 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

    - name: "sdist install under Windows"
      os: "windows"
      services: []  # service is not need
      before_script: []
      # language : cpp is necessary for windows
      language: "cpp"
      env:
        - PATH=/c/Python37:/c/Python37/Scripts:/c/tools/mysql/current/bin:/c/Program Files/PostgreSQL/10/bin:$PATH
      before_install:
        - 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`
{'fraction_non_alphanumeric': 0.1207352234502643, 'fraction_numerical': 0.0312349831811629, 'mean_word_length': 1.993527508090615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4374841', 'n_tokens_mistral': 3002, 'n_tokens_neox': 2724, 'n_words': 727}