From d46de36fb4bce6c8dbccbcf487606dfc6976a658 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Wed, 7 Jun 2017 17:48:20 +0100 Subject: [PATCH] Tweaks - I think I've figured out why python 3.x tests were hanging - something wrong in coverage! --- .coveragerc | 9 +++++++++ .gitlab-ci.yml | 9 +++++++-- pytest.ini | 2 +- setup.py | 2 ++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..fe8ac8f6a --- /dev/null +++ b/.coveragerc @@ -0,0 +1,9 @@ +[run] +source = + fsl + +# async.py is not currently covered because +# it otherwise causes async unit tests to +# hang when running in docker/python 3.x/xvfb-run! +omit = + fsl/utils/async.py \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 65fd42b15..bb62ccaff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -225,7 +225,6 @@ variables: - apt-get update -y - apt-get install -y xvfb libgtk-3-0 - apt-get install -y libnotify4 freeglut3 libsdl1.2debian - - apt-get install -y libwebkitgtk-3.0-0 libgstreamer-plugins-base1.0 # Linux builds for wxPython are currently not # on pypi, but are available at thisd url. @@ -234,8 +233,14 @@ variables: # All other deps can be installed as # normal. scipy is required by nibabel, # but not listed in its requirements. + # We install test dependencies through + # pip, because if we let setuptools do + # it, it will build/install everything + # from source, rather than using wheels. - pip install -r requirements.txt - pip install scipy + - pip install sphinx sphinx-rtd-theme + - pip install pytest pytest-cov pytest-html pytest-runner mock coverage # We need the FSL atlases for the atlas # tests, and need $FSLDIR to be defined @@ -245,7 +250,7 @@ variables: # Finally, run the damned tests. - su -s /bin/bash -c "xvfb-run python setup.py test" nobody - - coverage report -m + - python -m coverage report test:2.7: diff --git a/pytest.ini b/pytest.ini index 4352354c3..4df66d4d4 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] testpaths = tests -addopts = -s -v --niters=50 --cov=fsl --cov-report=html --html=report.html +addopts = -s -v --niters=50 --cov-report=html --html=report.html diff --git a/setup.py b/setup.py index 46e9abedd..37848d4f0 100644 --- a/setup.py +++ b/setup.py @@ -98,7 +98,9 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Topic :: Software Development :: Libraries :: Python Modules'], packages=packages, -- GitLab