项目文件夹

文件
T
2020-02-25 23:04:17 -05:00

161 行
7.2 KiB
YAML

language: python
# ====== Linux =========
os:
- linux
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
# Install dependencies
before_install:
- python --version
- pip install -U -q pip
- pip install -U -q pytest
- pip install -q pytest-cov
- pip install -q tox-travis
- pip install -q -r requirements.txt
# Set-up for macOS and Windows and Linux
matrix:
include:
# ====== macOS =========
- name: "Python 2.7.14 on macOS 10.13"
os: osx
osx_image: xcode9.3 # Python 2.7.14_2 running on macOS 10.13
language: shell # 'language: python' errors on Travis CI macOS
before_install:
- python --version
- pip install -U -q pytest --user
- pip install -q pytest-cov --user
- pip install -q tox-travis --user
- pip install -q future --user # Needed for pytorch in python 2.7
- pip install -q -r requirements.txt --user
install:
- pip install -q torch torchvision --user
- pip install -q -e . --user
script: python -m pytest --verbose --cov=cleanlab/ --cov-config .coveragerc_py27
- name: "Python 3.6.5 on macOS 10.13"
os: osx
osx_image: xcode9.4 # Python 3.6.5 running on macOS 10.13
language: shell # 'language: python' is an error on Travis CI macOS
before_install:
- python --version
- pip3 install -U -q pip
- pip3 install -U -q pytest
- pip3 install -q pytest-cov
- pip3 install -q tox-travis
- pip3 install -q -r requirements.txt
install:
- pip install -q torch torchvision
- pip3 install -q -e .
script: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc_py3
- name: "Python 3.7.3 on macOS 10.13"
os: osx
osx_image: xcode10.2 # Python 3.7.3 running on macOS 10.13
language: shell # 'language: python' is an error on Travis CI macOS
before_install:
- python --version
- pip3 install -U -q pip
- pip3 install -U -q pytest
- pip3 install -q pytest-cov
- pip3 install -q tox-travis
- pip3 install -q -r requirements.txt
install:
- pip install -q torch torchvision
- pip3 install -q -e .
script: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc_py3
# ====== WINDOWS =========
- name: "Python 2.7 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' errors Travis CI Windows
before_install:
- choco install python2
- python --version
- python -m pip install --upgrade pip
- pip install --upgrade pytest
- pip install -q pytest-cov
- pip install -q tox-travis
- pip install -q future # Needed for pytorch in python 2.7
- pip install -q -r requirements.txt
env: PATH=/c/Python27:/c/Python27/Scripts:$PATH
install:
# Windows python 2.7 has issues with pytorch. Do not install.
# - pip install -q https://download.pytorch.org/whl/cpu/torch_stable.html
# - pip install torchvision
- pip install -q -e .
script: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc_py27
- name: "Python 3.5.4 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.5.4
- python --version
- python -m pip install --upgrade pip
- pip3 install --upgrade pytest
- pip3 install -q pytest-cov
- pip3 install -q tox-travis
- pip3 install -q -r requirements.txt
install:
- pip3 install -q torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip3 install -q -e .
env: PATH=/c/Python35:/c/Python35/Scripts:$PATH
script: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc_py3
- name: "Python 3.6.8 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.6.8
- python --version
- python -m pip install --upgrade pip
- pip3 install --upgrade pytest
- pip3 install -q pytest-cov
- pip3 install -q tox-travis
- pip3 install -q -r requirements.txt
env: PATH=/c/Python36:/c/Python36/Scripts:$PATH
install:
- pip3 install -q torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip3 install -q -e .
script: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc_py3
- name: "Python 3.7.4 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.7.4
- python --version
- python -m pip install --upgrade pip
- pip3 install --upgrade pytest
- pip3 install -q pytest-cov
- pip3 install -q tox-travis
- pip3 install -q -r requirements.txt
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
install:
- pip3 install -q torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip3 install -q -e .
script: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc_py3
# Install cleanlab, pytorch, torchvision.
install:
# For testing cleanlab.models
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install -q https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp27-cp27mu-linux_x86_64.whl; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install -q future; fi # Needed for pytorch in python 2.7
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then pip3 install -q https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip3 install -q https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whl; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then pip3 install -q https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp37-cp37m-linux_x86_64.whl; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install -q torchvision --no-cache-dir; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then pip install -q torchvision; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip install -q torchvision; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then pip install -q torchvision; fi
# - if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then git clone -q https://github.com/facebookresearch/fastText.git && pip install -q -e fastText/.; fi
# - if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then git clone -q https://github.com/facebookresearch/fastText.git && pip install -q -e fastText/.; fi
# - if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then git clone -q https://github.com/facebookresearch/fastText.git && pip install -q -e fastText/.; fi
- pip install -q -e .
# Runs tox in bash. Tox will run tox.ini.
script:
- tox
# After success upload results to code coverage.
after_success:
- bash <(curl -s https://codecov.io/bash) -t c1817983-8176-4535-b31d-9fa9d649438a