Skip to content

Commit f3bc549

Browse files
committed
Installing pyqt only in Python 2.7
Since pyqt is not available on PyPI, we can't install it using pip, relying only on apt-get to install it if we are in python 2.7. PySide is available, but in order to reduce build time we also install it using apt-get when in Python 2.7.
1 parent aa65c0f commit f3bc549

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

.travis.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,42 @@
11
language: python
22
python:
3-
- "2.7"
4-
- "3.4"
5-
before_script:
6-
- "export DISPLAY=:99.0"
7-
- "sh -e /etc/init.d/xvfb start"
8-
- sleep 3
3+
- 2.7
4+
- 3.4
95

106
env:
117
- PYTEST_VERSION=2.5.2 PYTEST_QT_FORCE_PYQT=true
128
- PYTEST_VERSION=2.5.2 PYTEST_QT_FORCE_PYQT=false
139

10+
matrix:
11+
exclude:
12+
- python: 3.4
13+
env: PYTEST_VERSION=2.5.2 PYTEST_QT_FORCE_PYQT=true
14+
1415
install:
1516
# PySide
16-
- if [[ $PYTEST_QT_FORCE_PYQT == 'false' ]]; then
17-
- pip install pyside
17+
- echo $TRAVIS_PYTHON_VERSION
18+
- if [[ "$PYTEST_QT_FORCE_PYQT" == "false" && "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
19+
- sudo apt-get install -qq python-pyside;
20+
- ln -s /usr/lib/python$TRAVIS_PYTHON_VERSION/dist-packages/PySide /home/travis/virtualenv/python$TRAVIS_PYTHON_VERSION/lib/python$TRAVIS_PYTHON_VERSION/site-packages -v;
21+
- elif [[ "$PYTEST_QT_FORCE_PYQT" == "false" && "$TRAVIS_PYTHON_VERSION" != "2.7" ]]; then
22+
- pip install pyside;
1823
- fi
1924

2025
# PyQt4
21-
- if [[ $PYTEST_QT_FORCE_PYQT == 'true' ]]; then
22-
- pip install pyqt4
26+
- if [[ "$PYTEST_QT_FORCE_PYQT" == "true" ]]; then
27+
- sudo apt-get install -qq python-qt4
28+
- ln -s /usr/lib/python$TRAVIS_PYTHON_VERSION/dist-packages/PyQt4 /home/travis/virtualenv/python$TRAVIS_PYTHON_VERSION/lib/python$TRAVIS_PYTHON_VERSION/site-packages/PyQt4 -v
29+
- ln -s /usr/lib/python$TRAVIS_PYTHON_VERSION/dist-packages/sip* /home/travis/virtualenv/python$TRAVIS_PYTHON_VERSION/lib/python$TRAVIS_PYTHON_VERSION/site-packages -v
2330
- fi
2431

2532
# PyTest
2633
- pip uninstall -y pytest
2734
- pip install pytest==$PYTEST_VERSION
28-
35+
36+
before_script:
37+
- export DISPLAY=:99.0
38+
- sh -e /etc/init.d/xvfb start
39+
- sleep 3
40+
2941
script:
3042
- py.test

0 commit comments

Comments
 (0)