.travis.yml 2.74 KB
Newer Older
1 2
language: python
python: "3.6"
3 4 5 6
sudo: required
dist: trusty

env:
7 8
  global:
      # used by ci-helpers
9 10 11
      - DEPS="pytest tox coveralls six"
      - MINICONDA_VERSION=latest
      - DISPLAY=":99.0"
12

13
  matrix:
14
      - LINTING=1
15 16 17 18 19 20 21
      - PYTEST_QT_API=pyqt4   PYQT_PACKAGE="pyqt=4.*" PYTHON_VERSION=2.7
      - PYTEST_QT_API=pyqt4v2 PYQT_PACKAGE="pyqt=4.*" PYTHON_VERSION=2.7
      - PYTEST_QT_API=pyside  PYQT_PACKAGE="pyside=1.*" PYTHON_VERSION=2.7

      - PYTEST_QT_API=pyqt4   PYQT_PACKAGE="pyqt=4.*" PYTHON_VERSION=3.4
      - PYTEST_QT_API=pyqt4v2 PYQT_PACKAGE="pyqt=4.*" PYTHON_VERSION=3.4
      - PYTEST_QT_API=pyside  PYQT_PACKAGE="pyside=1.*" PYTHON_VERSION=3.4
22 23

      - PYTEST_QT_API=pyqt5   PYQT_PACKAGE="pyqt=5.*" PYTHON_VERSION=3.5
24
      - PYTEST_QT_API=pyside2   PYQT_PACKAGE="pyside2=2.*" PYTHON_VERSION=3.5
25

26 27 28
      - PYTEST_QT_API=pyqt5   PYQT_PACKAGE="pyqt=5.*" PYTHON_VERSION=3.6
      - PYTEST_QT_API=pyside2   PYQT_PACKAGE="pyside2=2.*" PYTHON_VERSION=3.6

29 30 31 32 33
matrix:
  # PySide2 crashes: #202
  allow_failures:
    - env: PYTEST_QT_API=pyside2   PYQT_PACKAGE="pyside2=2.*" PYTHON_VERSION=3.5
    - env: PYTEST_QT_API=pyside2   PYQT_PACKAGE="pyside2=2.*" PYTHON_VERSION=3.6
34

35 36 37 38 39 40 41 42 43
install:
  - |
    if [ $LINTING == "1" ]; then
      pip install -U pip
      pip install tox
    else
      # Xvfb / window manager
      sudo apt-get update
      sudo apt-get install -y xvfb herbstluftwm
44

45 46
      # courtesy of https://github.com/astropy/ci-helpers/blob/master/travis/setup_conda_linux.sh
      /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
47

48 49 50 51 52 53 54 55 56
      # Setup miniconda
      wget https://repo.continuum.io/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh -O miniconda.sh
      bash miniconda.sh -b -p $HOME/miniconda
      export PATH="$HOME/miniconda/bin:$PATH"
      conda config --add channels conda-forge
      conda config --set always_yes yes --set changeps1 no
      conda create -n test --quiet python=${PYTHON_VERSION} ${DEPS} ${PYQT_PACKAGE}
      source activate test && pip install -e .
    fi
57

58 59 60
before_script:
 - "herbstluftwm &"
 - sleep 1
61 62

script:
63 64 65 66 67 68
  - |
    if [ $LINTING == "1" ]; then
      tox -e linting
    else
      source activate test && catchsegv coverage run --source=pytestqt -m pytest -v tests
    fi
69 70 71 72 73 74

after_success:
 - coveralls

deploy:
  provider: pypi
75
  skip_upload_docs: true
76
  user: nicoddemus
77
  distributions: sdist bdist_wheel
78
  password:
79
    secure: Fql0uLFWz+D6p36BUm+2WB5tjUiuCkOFpU68Dnycn5cIRqZQuBzfNNZPVGHgIUGNZ5rC+rJC+edEvJoF2AB9cQ7kz86SzZuQHdEOwsnR4KQw2tkD5fw2BqH4bQ56SQ+UHAsyQAuDkjShHTrwSTJrzShIE5Poma5BqmqC4mRSgbI=
80 81 82
  on:
    tags: true
    repo: pytest-dev/pytest-qt
83
    condition: $PYTEST_QT_API = pyqt5