pyqtgraph/.travis.yml

184 lines
5.8 KiB
YAML
Raw Normal View History

2014-03-24 20:52:33 +00:00
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.
2014-03-24 21:12:06 +00:00
notifications:
email: false
2014-03-24 20:52:33 +00:00
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
2014-03-26 15:13:18 +00:00
- PYTHON=3.2 QT=pyqt TEST=standard
- PYTHON=3.2 QT=pyside TEST=standard
2014-03-30 06:09:41 +00:00
#- PYTHON=3.2 QT=pyqt5 TEST=standard
2014-03-24 20:52:33 +00:00
before_install:
2014-03-25 01:17:15 +00:00
- 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;
2014-03-24 20:52:33 +00:00
install:
2014-03-25 03:51:45 +00:00
# Dependencies
2014-03-25 03:47:30 +00:00
- if [ "${PYTHON}" == "2.7" ]; then
2014-03-25 14:23:10 +00:00
travis_retry sudo apt-get -qq -y install python-numpy &&
2014-03-26 11:39:19 +00:00
export PIP=pip &&
2014-03-26 04:29:29 +00:00
sudo ${PIP} install pytest &&
2014-03-26 11:39:19 +00:00
sudo ${PIP} install flake8 &&
2014-03-26 03:31:31 +00:00
export PYTEST=py.test;
2014-03-25 03:47:30 +00:00
else
2014-03-25 14:23:10 +00:00
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 &&
2014-03-26 11:39:19 +00:00
export PIP=pip3.2 &&
2014-03-26 04:29:29 +00:00
sudo ${PIP} install pytest &&
2014-03-26 11:39:19 +00:00
sudo ${PIP} install flake8 &&
2014-03-26 04:16:04 +00:00
export PYTEST=py.test-3.2;
2014-03-25 03:47:30 +00:00
fi;
2014-03-25 00:56:01 +00:00
2014-03-25 03:51:45 +00:00
# Qt
- if [ "${PYTHON}" == "2.7" ]; then
2014-03-24 21:12:06 +00:00
if [ ${QT} == 'pyqt' ]; then
travis_retry sudo apt-get -qq -y install python-qt4 python-qt4-gl;
2014-03-24 20:52:33 +00:00
else
travis_retry sudo apt-get -qq -y install python-pyside.qtcore python-pyside.qtgui python-pyside.qtsvg python-pyside.qtopengl;
fi;
2014-03-26 15:13:18 +00:00
elif [ "${PYTHON}" == "3.2" ]; then
if [ ${QT} == 'pyqt' ]; then
2014-03-25 01:48:43 +00:00
travis_retry sudo apt-get -qq -y install python3-pyqt4;
2014-03-25 02:40:18 +00:00
elif [ ${QT} == 'pyside' ]; then
2014-03-25 01:48:43 +00:00
travis_retry sudo apt-get -qq -y install python3-pyside;
2014-03-25 02:40:18 +00:00
else
2014-03-26 04:29:29 +00:00
${PIP} search PyQt5;
${PIP} install PyQt5;
cat /home/travis/.pip/pip.log;
2014-03-24 20:52:33 +00:00
fi;
else
conda create -n testenv --yes --quiet pip python=$PYTHON &&
source activate testenv &&
2014-03-24 21:12:06 +00:00
if [ ${QT} == 'pyqt' ]; then
conda install --yes --quiet pyside;
2014-03-24 20:52:33 +00:00
else
conda install --yes --quiet pyside;
2014-03-24 20:52:33 +00:00
fi;
fi;
# Install PyOpenGL
2014-03-25 14:23:10 +00:00
- if [ "${PYTHON}" == "2.7" ]; then
echo "Using OpenGL stable version (apt)";
2014-03-24 20:52:33 +00:00
travis_retry sudo apt-get -qq -y install python-opengl;
2014-03-25 14:23:10 +00:00
else
2014-03-24 20:52:33 +00:00
echo "Using OpenGL stable version (pip)";
2014-03-26 04:29:29 +00:00
${PIP} install -q PyOpenGL;
2014-03-26 02:47:58 +00:00
cat /home/travis/.pip/pip.log;
2014-03-24 20:52:33 +00:00
fi;
2014-03-25 14:23:10 +00:00
2014-03-24 20:52:33 +00:00
2014-03-25 01:31:33 +00:00
# Debugging helpers
- uname -a
- cat /etc/issue
2014-03-25 17:29:00 +00:00
- if [ "${PYTHON}" == "2.7" ]; then
python --version;
else
python3 --version;
fi;
2014-03-25 01:31:33 +00:00
- apt-cache search python3-pyqt
2014-03-25 01:48:43 +00:00
- apt-cache search python3-pyside
2014-03-25 02:40:18 +00:00
- apt-cache search pytest
2014-03-25 15:55:43 +00:00
- apt-cache search python pip
- apt-cache search python qt5
2014-03-25 02:24:27 +00:00
2014-03-24 20:52:33 +00:00
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
2014-03-25 02:24:27 +00:00
# Make sure everyone uses the correct python
2014-03-25 03:04:37 +00:00
- mkdir ~/bin && ln -s `which python${PYTHON}` ~/bin/python
- export PATH=/home/travis/bin:$PATH
2014-03-25 02:31:56 +00:00
- which python
- python --version
2014-03-30 06:09:41 +00:00
# Help color output from each test
- RESET='\033[0m';
RED='\033[00;31m';
GREEN='\033[00;32m';
YELLOW='\033[00;33m';
BLUE='\033[00;34m';
PURPLE='\033[00;35m';
CYAN='\033[00;36m';
WHITE='\033[00;37m';
start_test() {
echo -e "${BLUE}======== Starting $1 ========${RESET}";
};
check_output() {
ret=$?;
if [ $ret == 0 ]; then
echo -e "${GREEN}>>>>>> $1 passed <<<<<<${RESET}";
else
echo -e "${RED}>>>>>> $1 FAILED <<<<<<${RESET}";
fi;
return $ret;
};
2014-03-24 20:52:33 +00:00
script:
2014-03-26 03:13:42 +00:00
# Run unit tests
2014-03-30 06:09:41 +00:00
- start_test "unit tests";
2014-03-30 06:16:05 +00:00
PYTHONPATH=. ${PYTEST} pyqtgraph/;
2014-03-30 06:09:41 +00:00
check_output "unit tests";
2014-03-24 20:52:33 +00:00
# check line endings
- if [ "${TEST}" == "extra" ]; then
2014-03-30 06:09:41 +00:00
start_test "line ending check";
2014-03-26 03:50:38 +00:00
! find ./ -name "*.py" | xargs file | grep CRLF &&
2014-03-26 03:13:42 +00:00
! find ./ -name "*.rst" | xargs file | grep CRLF;
2014-03-30 06:09:41 +00:00
check_output "line ending check";
2014-03-24 20:52:33 +00:00
fi;
# Check for style issues
- if [ "${TEST}" == "extra" ]; then
2014-03-30 06:09:41 +00:00
start_test "style check";
2014-03-25 02:24:27 +00:00
python setup.py style;
2014-03-30 06:09:41 +00:00
check_output "style check";
fi;
2014-03-25 02:24:27 +00:00
# Check install works
2014-03-30 06:09:41 +00:00
- start_test "install test";
sudo python${PYTHON} setup.py --quiet install;
check_output "install test";
2014-03-25 02:24:27 +00:00
# Check double-install fails
2014-03-26 03:50:38 +00:00
# Note the bash -c is because travis strips off the ! otherwise.
2014-03-30 06:09:41 +00:00
- start_test "double install test";
2014-03-30 06:16:05 +00:00
bash -c "! sudo python${PYTHON} setup.py --quiet install";
2014-03-30 06:09:41 +00:00
check_output "double install test";
2014-03-26 03:13:42 +00:00
# Check we can import pg
2014-03-30 06:09:41 +00:00
- start_test "import test";
2014-03-30 06:16:05 +00:00
echo "import sys; print(sys.path)" | python &&
2014-03-30 06:09:41 +00:00
cd /; echo "import pyqtgraph.examples" | python;
check_output "import test";
2014-03-26 03:13:42 +00:00
2014-03-24 20:52:33 +00:00