2014-03-30 06:51:32 +00:00
|
|
|
language: python
|
2015-07-17 18:49:01 +00:00
|
|
|
sudo: false
|
2014-03-30 06:51:32 +00:00
|
|
|
# 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
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Enable python 2 and python 3 builds
|
2019-05-22 22:44:54 +00:00
|
|
|
# Note that the python 2.6 support ended.
|
2016-11-01 22:25:54 +00:00
|
|
|
- PYTHON=2.7 QT=pyqt4 TEST=extra
|
2014-03-30 06:51:32 +00:00
|
|
|
- PYTHON=2.7 QT=pyside TEST=standard
|
2018-01-29 16:48:24 +00:00
|
|
|
- PYTHON=3.5 QT=pyqt5 TEST=standard
|
2015-07-17 18:49:01 +00:00
|
|
|
# - PYTHON=3.4 QT=pyside TEST=standard # pyside isn't available for 3.4 with conda
|
2014-03-30 06:51:32 +00:00
|
|
|
#- PYTHON=3.2 QT=pyqt5 TEST=standard
|
|
|
|
|
2019-06-21 19:54:04 +00:00
|
|
|
services:
|
|
|
|
- xvfb
|
2014-03-30 06:51:32 +00:00
|
|
|
|
|
|
|
before_install:
|
2015-07-17 18:49:01 +00:00
|
|
|
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-3.5.5-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.5.5-Linux-x86_64.sh -O miniconda.sh; fi
|
|
|
|
- chmod +x miniconda.sh
|
|
|
|
- ./miniconda.sh -b -p /home/travis/mc
|
|
|
|
- export PATH=/home/travis/mc/bin:$PATH
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2015-07-17 18:49:01 +00:00
|
|
|
# not sure what is if block is for
|
2014-03-30 06:51:32 +00:00
|
|
|
- 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:
|
2015-07-17 18:49:01 +00:00
|
|
|
- export GIT_FULL_HASH=`git rev-parse HEAD`
|
|
|
|
- conda update conda --yes
|
|
|
|
- conda create -n test_env python=${PYTHON} --yes
|
|
|
|
- source activate test_env
|
2016-12-14 19:02:40 +00:00
|
|
|
- conda install numpy scipy pyopengl pytest flake8 six coverage --yes
|
2015-07-18 12:53:34 +00:00
|
|
|
- echo ${QT}
|
|
|
|
- echo ${TEST}
|
|
|
|
- echo ${PYTHON}
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2016-11-01 22:25:54 +00:00
|
|
|
- if [ "${QT}" == "pyqt5" ]; then
|
2015-07-18 12:53:34 +00:00
|
|
|
conda install pyqt --yes;
|
|
|
|
fi;
|
2016-11-01 22:25:54 +00:00
|
|
|
- if [ "${QT}" == "pyqt4" ]; then
|
|
|
|
conda install pyqt=4 --yes;
|
|
|
|
fi;
|
2015-07-18 12:53:34 +00:00
|
|
|
- if [ "${QT}" == "pyside" ]; then
|
2015-07-17 19:17:26 +00:00
|
|
|
conda install pyside --yes;
|
|
|
|
fi;
|
2019-06-24 23:17:48 +00:00
|
|
|
- pip install pytest-xdist # multi-thread pytest
|
2015-07-17 20:25:43 +00:00
|
|
|
- pip install pytest-cov # add coverage stats
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2019-06-30 20:30:58 +00:00
|
|
|
# faulthandler support not built in to pytest for python 2.7
|
|
|
|
- if [ "${PYTHON}" == "2.7" ]; then
|
|
|
|
pip install pytest-faulthandler;
|
2019-07-01 18:25:29 +00:00
|
|
|
export PYTEST_ADDOPTS="--faulthandler-timeout=15";
|
2019-06-30 20:30:58 +00:00
|
|
|
fi;
|
|
|
|
|
2014-03-30 06:51:32 +00:00
|
|
|
# Debugging helpers
|
|
|
|
- uname -a
|
|
|
|
- cat /etc/issue
|
|
|
|
- if [ "${PYTHON}" == "2.7" ]; then
|
|
|
|
python --version;
|
|
|
|
else
|
|
|
|
python3 --version;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
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
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2015-07-17 18:49:01 +00:00
|
|
|
# Make sure everyone uses the correct python (this is handled by conda)
|
2014-03-30 06:51:32 +00:00
|
|
|
- which python
|
|
|
|
- python --version
|
2015-07-17 19:17:26 +00:00
|
|
|
- pwd
|
|
|
|
- ls
|
2014-03-30 06:51:32 +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;
|
|
|
|
};
|
|
|
|
|
|
|
|
- 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 &&
|
2015-07-31 17:31:54 +00:00
|
|
|
git fetch origin ${GIT_TARGET_EXTRA} &&
|
|
|
|
git checkout -qf FETCH_HEAD &&
|
2014-03-30 06:51:32 +00:00
|
|
|
git tag travis-merge-target &&
|
|
|
|
git gc --aggressive &&
|
|
|
|
TARGET_SIZE=`du -s . | sed -e "s/\t.*//"` &&
|
2015-07-31 17:31:54 +00:00
|
|
|
git pull origin ${GIT_SOURCE_EXTRA} &&
|
2014-03-30 06:51:32 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
script:
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2015-07-17 19:17:26 +00:00
|
|
|
- source activate test_env
|
2016-11-01 13:22:47 +00:00
|
|
|
|
|
|
|
# Check system info
|
|
|
|
- python -c "import pyqtgraph as pg; pg.systemInfo()"
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2019-06-24 23:17:48 +00:00
|
|
|
|
|
|
|
# Check install works
|
|
|
|
- start_test "install test";
|
|
|
|
python setup.py --quiet install;
|
|
|
|
check_output "install test";
|
|
|
|
|
2014-03-30 06:51:32 +00:00
|
|
|
# Run unit tests
|
|
|
|
- start_test "unit tests";
|
2019-07-01 16:21:40 +00:00
|
|
|
PYTHONPATH=. pytest --cov pyqtgraph -sv;
|
2014-03-30 06:51:32 +00:00
|
|
|
check_output "unit tests";
|
2015-08-01 15:37:09 +00:00
|
|
|
- echo "test script finished. Current directory:"
|
|
|
|
- pwd
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2014-03-30 06:51:32 +00:00
|
|
|
# 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;
|
|
|
|
|
|
|
|
# Check double-install fails
|
|
|
|
# Note the bash -c is because travis strips off the ! otherwise.
|
|
|
|
- start_test "double install test";
|
2015-07-17 19:17:26 +00:00
|
|
|
bash -c "! python setup.py --quiet install";
|
2014-03-30 06:51:32 +00:00
|
|
|
check_output "double install test";
|
2015-08-03 21:20:54 +00:00
|
|
|
|
2014-03-30 06:51:32 +00:00
|
|
|
# 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";
|
2015-07-17 19:51:38 +00:00
|
|
|
|
|
|
|
after_success:
|
2015-08-01 15:49:03 +00:00
|
|
|
- cd /home/travis/build/pyqtgraph/pyqtgraph
|
2015-08-01 16:06:05 +00:00
|
|
|
- pip install codecov --upgrade # add coverage integration service
|
2015-07-31 20:07:55 +00:00
|
|
|
- codecov
|
2015-08-01 16:06:05 +00:00
|
|
|
- pip install coveralls --upgrade # add another coverage integration service
|
2015-07-31 20:07:55 +00:00
|
|
|
- coveralls
|