tox: run tests with and without cython
This commit is contained in:
parent
d23308884b
commit
040c8536e2
30
tox.ini
30
tox.ini
@ -1,18 +1,39 @@
|
|||||||
[tox]
|
[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]
|
[testenv]
|
||||||
|
setenv =
|
||||||
|
nocy: CU2QU_WITH_CYTHON=0
|
||||||
|
cy: CU2QU_WITH_CYTHON=1
|
||||||
|
cy: CYTHON_TRACE=1
|
||||||
|
cy: CYTHON_ANNOTATE=1
|
||||||
deps =
|
deps =
|
||||||
-rtest-requirements.txt
|
-rtest-requirements.txt
|
||||||
-rrequirements.txt
|
-rrequirements.txt
|
||||||
|
cy: cython
|
||||||
|
changedir = {toxinidir}
|
||||||
commands =
|
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}
|
coverage run --parallel-mode -m pytest {posargs}
|
||||||
|
|
||||||
[testenv:htmlcov]
|
[testenv:htmlcov]
|
||||||
basepython = python3.6
|
|
||||||
deps =
|
deps =
|
||||||
coverage
|
coverage
|
||||||
skip_install = true
|
changedir = {toxinidir}
|
||||||
commands =
|
commands =
|
||||||
coverage combine
|
coverage combine
|
||||||
coverage report
|
coverage report
|
||||||
@ -23,14 +44,13 @@ passenv = *
|
|||||||
deps =
|
deps =
|
||||||
coverage
|
coverage
|
||||||
codecov
|
codecov
|
||||||
skip_install = true
|
|
||||||
ignore_outcome = true
|
ignore_outcome = true
|
||||||
|
changedir = {toxinidir}
|
||||||
commands =
|
commands =
|
||||||
coverage combine
|
coverage combine
|
||||||
codecov --env TRAVIS_PYTHON_VERSION
|
codecov --env TRAVIS_PYTHON_VERSION
|
||||||
|
|
||||||
[testenv:update-cython]
|
[testenv:update-cython]
|
||||||
skip_install = true
|
|
||||||
deps = requests
|
deps = requests
|
||||||
changedir = {toxinidir}
|
changedir = {toxinidir}
|
||||||
commands =
|
commands =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user