152 lines
4.9 KiB
YAML
152 lines
4.9 KiB
YAML
language: python
|
|
|
|
# Credit: Original .travis.yml lifted from VisPy
|
|
|
|
# Here we use anaconda for 2.6 and 3.3, since it provides the simplest
|
|
# interface for running different versions of Python. We could also use
|
|
# it for 2.7, but the Ubuntu system has installable 2.7 Qt4-GL, which
|
|
# allows for more complete testing.
|
|
notifications:
|
|
email: false
|
|
|
|
virtualenv:
|
|
system_site_packages: true
|
|
|
|
|
|
env:
|
|
# Enable python 2 and python 3 builds
|
|
# Note that the 2.6 build doesn't get flake8, and runs old versions of
|
|
# Pyglet and GLFW to make sure we deal with those correctly
|
|
#- PYTHON=2.6 QT=pyqt TEST=standard
|
|
- PYTHON=2.7 QT=pyqt TEST=extra
|
|
- PYTHON=2.7 QT=pyside TEST=standard
|
|
- PYTHON=3.3 QT=pyqt TEST=standard
|
|
- PYTHON=3.3 QT=pyside TEST=standard
|
|
- PYTHON=3.3 QT=pyqt5 TEST=standard
|
|
|
|
|
|
before_install:
|
|
- travis_retry sudo apt-get update;
|
|
# - if [ "${PYTHON}" != "2.7" ]; then
|
|
# wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh &&
|
|
# chmod +x miniconda.sh &&
|
|
# ./miniconda.sh -b &&
|
|
# export PATH=/home/$USER/anaconda/bin:$PATH &&
|
|
# conda update --yes conda &&
|
|
# travis_retry sudo apt-get -qq -y install libgl1-mesa-dri;
|
|
# fi;
|
|
|
|
|
|
install:
|
|
# Dependencies
|
|
- if [ "${PYTHON}" == "2.7" ]; then
|
|
travis_retry sudo apt-get -qq -y install python-numpy &&
|
|
sudo pip install pytest &&
|
|
sudo pip install flake8;
|
|
export PYTEST=py.test;
|
|
else
|
|
travis_retry sudo apt-get -qq -y install python3-numpy &&
|
|
curl http://python-distribute.org/distribute_setup.py | sudo python3 &&
|
|
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python3 &&
|
|
sudo pip3.2 install pytest &&
|
|
sudo pip3.2 install flake8;
|
|
which py.test;
|
|
which py.test3;
|
|
which py.test-3;
|
|
which py.test3.2;
|
|
which py.test-3.2;
|
|
fi;
|
|
|
|
# Qt
|
|
- if [ "${PYTHON}" == "2.7" ]; then
|
|
if [ ${QT} == 'pyqt' ]; then
|
|
travis_retry sudo apt-get -qq -y install python-qt4 python-qt4-gl;
|
|
else
|
|
travis_retry sudo apt-get -qq -y install python-pyside.qtcore python-pyside.qtgui python-pyside.qtsvg python-pyside.qtopengl;
|
|
fi;
|
|
elif [ "${PYTHON}" == "3.3" ]; then
|
|
if [ ${QT} == 'pyqt' ]; then
|
|
travis_retry sudo apt-get -qq -y install python3-pyqt4;
|
|
elif [ ${QT} == 'pyside' ]; then
|
|
travis_retry sudo apt-get -qq -y install python3-pyside;
|
|
else
|
|
sudo bash -c "echo 'deb http://us.archive.ubuntu.com/ubuntu/ saucy main restricted' >> /etc/apt/sources.list" &&
|
|
sudo bash -c "echo 'deb http://us.archive.ubuntu.com/ubuntu/ saucy universe' >> /etc/apt/sources.list" &&
|
|
sudo apt-get update &&
|
|
sudo apt-get install python3-pyqt5;
|
|
fi;
|
|
else
|
|
conda create -n testenv --yes --quiet pip python=$PYTHON &&
|
|
source activate testenv &&
|
|
if [ ${QT} == 'pyqt' ]; then
|
|
conda install --yes --quiet pyside;
|
|
else
|
|
conda install --yes --quiet pyside;
|
|
fi;
|
|
fi;
|
|
|
|
# Install PyOpenGL
|
|
- if [ "${PYTHON}" == "2.7" ]; then
|
|
echo "Using OpenGL stable version (apt)";
|
|
travis_retry sudo apt-get -qq -y install python-opengl;
|
|
else
|
|
echo "Using OpenGL stable version (pip)";
|
|
pip3.2 install -q PyOpenGL;
|
|
cat /home/travis/.pip/pip.log;
|
|
fi;
|
|
|
|
|
|
# Debugging helpers
|
|
- uname -a
|
|
- cat /etc/issue
|
|
- if [ "${PYTHON}" == "2.7" ]; then
|
|
python --version;
|
|
else
|
|
python3 --version;
|
|
fi;
|
|
- apt-cache search python3-pyqt
|
|
- apt-cache search python3-pyside
|
|
- apt-cache search pytest
|
|
- apt-cache search python pip
|
|
- apt-cache search python qt5
|
|
|
|
|
|
before_script:
|
|
# We need to create a (fake) display on Travis, let's use a funny resolution
|
|
- export DISPLAY=:99.0
|
|
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
|
|
|
|
# Make sure everyone uses the correct python
|
|
- mkdir ~/bin && ln -s `which python${PYTHON}` ~/bin/python
|
|
- export PATH=/home/travis/bin:$PATH
|
|
- which python
|
|
- python --version
|
|
|
|
script:
|
|
- PGDIR=`pwd`
|
|
|
|
# Run unit tests
|
|
- PYTHONPATH=. ${PYTEST} pyqtgraph/
|
|
|
|
# check line endings
|
|
- if [ "${TEST}" == "extra" ]; then
|
|
! find ./ -name "*.py" | xargs file | grep CRLF;
|
|
! find ./ -name "*.rst" | xargs file | grep CRLF;
|
|
fi;
|
|
|
|
# Check for style issues
|
|
- if [ "${TEST}" == "extra" ]; then
|
|
python setup.py style;
|
|
fi;
|
|
|
|
# Check install works
|
|
- sudo python setup.py --quiet install
|
|
|
|
# Check double-install fails
|
|
- ! sudo python setup.py --quiet install
|
|
|
|
# Check we can import pg
|
|
- cd /; echo "import pyqtgraph.examples" | python
|
|
|
|
|