tox: run tests with and without cython

This commit is contained in:
Cosimo Lupo 2018-09-26 15:31:06 +01:00
parent d23308884b
commit 040c8536e2
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

30
tox.ini
View File

@ -1,18 +1,39 @@
[tox]
envlist = py27, py36, htmlcov
envlist = py{27,37}-{cy,nocy}, htmlcov
package_name = cu2qu
; we skip tox's own sdist generation as we need to pass different environment
; variables for testing buiding with and without cython
skipsdist = true
[testenv]
setenv =
nocy: CU2QU_WITH_CYTHON=0
cy: CU2QU_WITH_CYTHON=1
cy: CYTHON_TRACE=1
cy: CYTHON_ANNOTATE=1
deps =
-rtest-requirements.txt
-rrequirements.txt
cy: cython
changedir = {toxinidir}
commands =
# create source distribution in a temp dir
python setup.py --quiet sdist --dist-dir {envtmpdir}
# install from sdist
python -m pip install --ignore-installed --pre --no-deps --no-cache-dir --find-links {envtmpdir} {[tox]package_name}
# ensure we are running the requested cu2qu version (compiled vs interpreted)
nocy: python -c "import sys, cu2qu.cu2qu; cu2qu.cu2qu.COMPILED and sys.exit(1)"
cy: python -c "import sys, cu2qu.cu2qu; cu2qu.cu2qu.COMPILED or sys.exit(1)"
# run tests with code coverage enabled
coverage run --parallel-mode -m pytest {posargs}
[testenv:htmlcov]
basepython = python3.6
deps =
coverage
skip_install = true
changedir = {toxinidir}
commands =
coverage combine
coverage report
@ -23,14 +44,13 @@ passenv = *
deps =
coverage
codecov
skip_install = true
ignore_outcome = true
changedir = {toxinidir}
commands =
coverage combine
codecov --env TRAVIS_PYTHON_VERSION
[testenv:update-cython]
skip_install = true
deps = requests
changedir = {toxinidir}
commands =