From 6583b469baec7bb592ddb1447183f9a3b75c8565 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Thu, 14 Nov 2013 16:11:57 +0200 Subject: [PATCH 1/5] Add coverall support --- .coveragerc | 7 +++++++ .travis.yml | 22 +++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..c3c13f5f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +# Configuration for coverage.py + +[run] +branch = True +source = skimage +include = */skimage/* + diff --git a/.travis.yml b/.travis.yml index 3c627c85..c071c7f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,12 +40,15 @@ before_install: - fi - if [[ $PYVER == '3.x' ]]; then - sudo apt-get install $PYTHON-pyqt4; - - pip install matplotlib; + - pip install --use-mirrors matplotlib; - fi - - pip install cython - - pip install flake8 - - pip install six + - pip install --use-mirrors cython + - pip install --use-mirrors flake8 + - pip install --use-mirrors six + + - pip install --use-mirrors nose-cov + - pip install --use-mirrors python-coveralls - python check_bento_build.py @@ -53,17 +56,22 @@ install: - python setup.py build_ext --inplace script: - # Setup matplotlib settings + # Matplotlib settings - mkdir $HOME/.matplotlib - touch $HOME/.matplotlib/matplotlibrc - "echo 'backend : Agg' > $HOME/.matplotlib/matplotlibrc" - "echo 'backend.qt4 : PyQt4' >> $HOME/.matplotlib/matplotlibrc" + # Run all tests - - python -c "import skimage, sys, io; sys.exit(skimage.test_verbose())" - - python -c "import skimage, sys, io; sys.exit(skimage.doctest_verbose())" + - nosetests-$PYVER --exe -v --with-doctest --with-cov --cov skimage --cov-config .coveragerc skimage + # Run all doc examples - export PYTHONPATH=$(pwd):$PYTHONPATH - for f in doc/examples/*.py; do $PYTHON "$f"; if [ $? -ne 0 ]; then exit 1; fi done - for f in doc/examples/applications/*.py; do $PYTHON "$f"; if [ $? -ne 0 ]; then exit 1; fi done + # Run pep8 and flake tests - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples + +after_success: + - coveralls --config_file .coveragerc From 588a86e7d35f8a044c28b692f02c9d35ca8b6532 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Fri, 15 Nov 2013 11:15:28 +0200 Subject: [PATCH 2/5] Execute coveralls without flags. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c071c7f6..bf78455a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,4 +74,4 @@ script: - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples after_success: - - coveralls --config_file .coveragerc + - coveralls From 531f0c2cfb936dad457b4a1b57acf2c72a0613c9 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sun, 17 Nov 2013 11:49:14 +0200 Subject: [PATCH 3/5] Change to test directory before running coveralls --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index bf78455a..abbb3b7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,4 +74,5 @@ script: - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples after_success: + - cd for_test - coveralls From 5d9d5e99afe0ab8e48a6f9806838ee5005036e8a Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Mon, 18 Nov 2013 10:22:11 +0200 Subject: [PATCH 4/5] Ignore setup. No need for tmp dir any longer. --- .coveragerc | 2 ++ .travis.yml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index c3c13f5f..f7ea687a 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,4 +4,6 @@ branch = True source = skimage include = */skimage/* +omit = + */setup.py diff --git a/.travis.yml b/.travis.yml index abbb3b7d..bf78455a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,5 +74,4 @@ script: - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples after_success: - - cd for_test - coveralls From 1280f38378d3422da96791fe44fd19c6aa154aa8 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 20 Nov 2013 17:48:56 +0200 Subject: [PATCH 5/5] Fix invocation of nosetests. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bf78455a..2972fd9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ script: - "echo 'backend.qt4 : PyQt4' >> $HOME/.matplotlib/matplotlibrc" # Run all tests - - nosetests-$PYVER --exe -v --with-doctest --with-cov --cov skimage --cov-config .coveragerc skimage + - nosetests --exe -v --with-doctest --with-cov --cov skimage --cov-config .coveragerc skimage # Run all doc examples - export PYTHONPATH=$(pwd):$PYTHONPATH