pyqtgraph/.travis.yml
Luke Campagnola 6b66edfd46 Added Travis CI support
Fixed bugs / style issues to please Lord Travis

Squashed commit of the following:

commit f25048a1e1
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:40:47 2014 -0400

    syntax

commit cc8b69695a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:36:49 2014 -0400

    add size check, diff style check

commit 5d5ea065a4
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:16:05 2014 -0400

    travis fix

commit b154c6d997
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:09:41 2014 -0400

    travis, flake colored output

commit 46921dcd87
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 12:37:54 2014 -0400

    fix pyside+py3 bugs to satisfy CI

commit 1d30f3c5c7
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 11:13:18 2014 -0400

    fix py3 tests

commit 426578fa4c
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 07:39:19 2014 -0400

    fix pytest install

commit 88a13c1a71
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 00:29:29 2014 -0400

    qt5 updates

commit 51995488cc
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 00:16:04 2014 -0400

    correct py.test command for py3

commit e2b02fbcbd
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:50:38 2014 -0400

    fix 2nd install test

commit 4b3e3ee04a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:31:31 2014 -0400

    syntax error

commit 250eabdb34
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:13:42 2014 -0400

    look for py.test3

commit 9f9bca47c1
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:54:19 2014 -0400

    fix syntax

commit 0a871c6f36
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:47:58 2014 -0400

    output pip build log

commit dbce58d8cd
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:38:55 2014 -0400

    no comments allowed between shall lines

commit b79c06121d
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 20:56:35 2014 -0400

    another pip try

commit 09f4f5d82a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 13:36:09 2014 -0400

    pip correction

commit 0eedb5c18e
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 13:29:00 2014 -0400

    correct py version output

commit d9fd039be2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 11:55:43 2014 -0400

    apt checks

commit cf95ccef86
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 10:23:10 2014 -0400

    alternate pip install method

commit bee0bcddfe
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:51:45 2014 -0400

    correct deps install

commit 963a4211fc
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:47:30 2014 -0400

    fixes

commit 0c86cd1dc2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:31:06 2014 -0400

    permission fix

commit 5d04ef53b8
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:30:19 2014 -0400

    Fix py.test version selection

commit b0e6c7cb94
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:25:34 2014 -0400

    try another pyqt5 install method

commit 422a792866
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:12:36 2014 -0400

    syntax error

commit 533133905a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:04:37 2014 -0400

    fixes

commit 8d65211ba4
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:40:18 2014 -0400

    Add Qt5 test
    minor fixes

commit 4484efaefe
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:31:56 2014 -0400

    use correct py.test for python version

commit 5d2441a29b
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:24:27 2014 -0400

    add setup tests

commit 9291db64f2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:48:43 2014 -0400

    fix py3-pyqt install

commit a7aa675c5a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:31:33 2014 -0400

    travis tests

commit e71cd2b23a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:17:15 2014 -0400

    more corrections

commit 527df3bca8
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 20:56:01 2014 -0400

    travis corrections

commit 87d65cac4a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 20:48:02 2014 -0400

    Add flake tests
    Correct style in a few files to please Lord Travis

commit 537028f88f
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:36:24 2014 -0400

    minimize pyside package install
    correct line endings to satisfy Lord Travis

commit 1e3cc95e37
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:23:03 2014 -0400

    enable pyside, line ending check
    fix test

commit d7df4517f9
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:12:06 2014 -0400

    syntax fix

commit 1ad77a2155
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:00:30 2014 -0400

    alt. pytest install

commit 5edcc02072
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 16:52:33 2014 -0400

    Added initial travis.yml
2014-03-30 02:51:32 -04:00

231 lines
7.4 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.2 QT=pyqt TEST=standard
- PYTHON=3.2 QT=pyside TEST=standard
#- PYTHON=3.2 QT=pyqt5 TEST=standard
before_install:
- TRAVIS_DIR=`pwd`
- 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;
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
GIT_SOURCE_EXTRA="+refs/pull/${TRAVIS_PULL_REQUEST}/merge";
else
GIT_TARGET_EXTRA="";
GIT_SOURCE_EXTRA="";
fi;
# to aid in debugging
- echo ${TRAVIS_BRANCH}
- echo ${TRAVIS_REPO_SLUG}
- echo ${GIT_TARGET_EXTRA}
- echo ${GIT_SOURCE_EXTRA}
install:
# Dependencies
- if [ "${PYTHON}" == "2.7" ]; then
travis_retry sudo apt-get -qq -y install python-numpy &&
export PIP=pip &&
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 &&
export PIP=pip3.2 &&
sudo ${PIP} install pytest &&
sudo ${PIP} install flake8 &&
export PYTEST=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.2" ]; 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
${PIP} search PyQt5;
${PIP} install PyQt5;
cat /home/travis/.pip/pip.log;
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)";
${PIP} 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
# 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;
};
- if [ "${TEST}" == "extra" ]; then
start_test "repo size check";
mkdir ~/repo-clone && cd ~/repo-clone &&
git init && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &&
git fetch origin ${GIT_TARGET_EXTRA} &&
git checkout -qf FETCH_HEAD &&
git tag travis-merge-target &&
git gc --aggressive &&
TARGET_SIZE=`du -s . | sed -e "s/\t.*//"` &&
git pull origin ${GIT_SOURCE_EXTRA} &&
git gc --aggressive &&
MERGE_SIZE=`du -s . | sed -e "s/\t.*//"` &&
if [ "${MERGE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr \( ${MERGE_SIZE} - ${TARGET_SIZE} \)`;
else
SIZE_DIFF=0;
fi;
fi;
- cd $TRAVIS_DIR
script:
# Run unit tests
- start_test "unit tests";
PYTHONPATH=. ${PYTEST} pyqtgraph/;
check_output "unit tests";
# check line endings
- if [ "${TEST}" == "extra" ]; then
start_test "line ending check";
! find ./ -name "*.py" | xargs file | grep CRLF &&
! find ./ -name "*.rst" | xargs file | grep CRLF;
check_output "line ending check";
fi;
# Check repo size does not expand too much
- if [ "${TEST}" == "extra" ]; then
start_test "repo size check";
echo -e "Estimated content size difference = ${SIZE_DIFF} kB" &&
test ${SIZE_DIFF} -lt 100;
check_output "repo size check";
fi;
# Check for style issues
- if [ "${TEST}" == "extra" ]; then
start_test "style check";
cd ~/repo-clone &&
git reset -q travis-merge-target &&
python setup.py style &&
check_output "style check";
fi;
- cd $TRAVIS_DIR
# Check install works
- start_test "install test";
sudo python${PYTHON} setup.py --quiet install;
check_output "install test";
# Check double-install fails
# Note the bash -c is because travis strips off the ! otherwise.
- start_test "double install test";
bash -c "! sudo python${PYTHON} setup.py --quiet install";
check_output "double install test";
# Check we can import pg
- start_test "import test";
echo "import sys; print(sys.path)" | python &&
cd /; echo "import pyqtgraph.examples" | python;
check_output "import test";