diff --git a/.travis.yml b/.travis.yml index fae9ed589..28bcb5f66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ -language: generic - sudo: required -dist: trusty +language: generic + +cache: + - pip branches: only: @@ -14,33 +15,77 @@ notifications: env: global: # used by ci-helpers - - SETUP_XVFB=true PIP_DEPENDENCIES='hacking pytest pytest-qt' - matrix: - - PYTEST_QT_API=pyqt4v2 PYQT_PACKAGE='pyqt=4' PYTHON_VERSION=2.7 - - PYTEST_QT_API=pyside2 CONDA_CHANNELS='conda-forge' PYQT_PACKAGE='pyside2' PYTHON_VERSION=2.7 - - PYTEST_QT_API=pyside2 CONDA_CHANNELS='conda-forge' PYQT_PACKAGE='pyside2' PYTHON_VERSION=3.6 - - PYTEST_QT_API=pyqt5 PYQT_PACKAGE='pyqt=5' PYTHON_VERSION=2.7 - - PYTEST_QT_API=pyqt5 PYQT_PACKAGE='pyqt=5' PYTHON_VERSION=3.6 + - SETUP_XVFB=true + - PIP_DEPENDENCIES='hacking pytest pytest-qt' -install: - - sudo apt-get update - - # Xvfb / window manager - - sudo apt-get install -y xvfb herbstluftwm +matrix: + include: + - os: linux + dist: trusty + env: + - PYTEST_QT_API=pyqt4v2 + - PYQT_PACKAGE='pyqt=4' + - PYTHON_VERSION=2.7 + - os: linux + dist: trusty + env: + - PYTEST_QT_API=pyside2 + - CONDA_CHANNELS='conda-forge' + - PYQT_PACKAGE='pyside2' + - PYTHON_VERSION=2.7 + - os: linux + dist: trusty + env: + - PYTEST_QT_API=pyside2 + - CONDA_CHANNELS='conda-forge' + - PYQT_PACKAGE='pyside2' + - PYTHON_VERSION=3.6 + - os: linux + dist: trusty + env: + - PYTEST_QT_API=pyqt5 + - PYQT_PACKAGE='pyqt=5' + - PYTHON_VERSION=2.7 + - os: linux + dist: trusty + env: + - PYTEST_QT_API=pyqt5 + - PYQT_PACKAGE='pyqt=5' + - PYTHON_VERSION=3.6 + # Skip other versions than pyqt5 for macOS + - os: osx + env: + - PYTEST_QT_API=pyqt5 + - PYQT_PACKAGE='pyqt=5' + - PYTHON_VERSION=3.6 +install: + - | + if [ $TRAVIS_OS_NAME = "linux" ]; then + sudo apt-get update + # Xvfb / window manager + sudo apt-get install -y xvfb herbstluftwm + fi # Setup miniconda - git clone --depth 1 git://github.com/astropy/ci-helpers.git - CONDA_DEPENDENCIES=$PYQT_PACKAGE source ci-helpers/travis/setup_conda.sh - source activate test && pip install . before_script: - - "herbstluftwm &" - - sleep 1 + - | + if [ $TRAVIS_OS_NAME = "linux" ]; then + "herbstluftwm &" + sleep 1 + fi script: - source activate test - flake8 examples labelme setup.py tests - - pytest -v tests + - | + if [ $TRAVIS_OS_NAME = "linux" ]; then + # gui tests + pytest -v tests + fi - labelme --help - labelme --version - (cd examples/tutorial && rm -rf apc2016_obj3_json && labelme_json_to_dataset apc2016_obj3.json && python load_label_png.py && git checkout -- .) @@ -50,8 +95,8 @@ script: after_script: # build standalone executable file - source deactivate - - sudo apt-get install python-virtualenv - - virtualenv venv + - sudo apt-get install python3 python-virtualenv + - virtualenv venv --python=$(which python3) - . venv/bin/activate - pip install . - pip uninstall matplotlib