This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtox.ini
97 lines (86 loc) · 2.46 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[tox]
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
; download the latest pip, setuptools and wheel when creating the venv
download = true
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 --no-build-isolation --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]
deps =
coverage
changedir = {toxinidir}
commands =
coverage combine
coverage report
coverage html
[testenv:codecov]
passenv = *
deps =
coverage
codecov
ignore_outcome = true
changedir = {toxinidir}
commands =
coverage combine
codecov --env TRAVIS_PYTHON_VERSION
[testenv:update-cython]
deps = requests
changedir = {toxinidir}
commands =
python tools/update_cython_shadow.py {posargs}
[testenv:sdist]
deps =
setuptools
cython
changedir = {toxinidir}
commands =
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
python setup.py --with-cython sdist --dist-dir dist
[testenv:pure-wheel]
deps =
{[testenv:sdist]deps}
pip
wheel
setenv = CU2QU_WITH_CYTHON=0
changedir = {toxinidir}
commands =
{[testenv:sdist]commands}
pip wheel --pre --no-deps --no-cache-dir --wheel-dir dist --find-links dist \
--no-binary {[tox]package_name} {[tox]package_name}
[testenv:native-wheel]
deps = {[testenv:pure-wheel]deps}
setenv = CU2QU_WITH_CYTHON=1
changedir = {toxinidir}
commands = {[testenv:pure-wheel]commands}
; we only upload the source distribution to PyPI (for now)
[testenv:pypi]
deps =
{[testenv:sdist]deps}
twine
passenv = TWINE_USERNAME TWINE_PASSWORD
changedir = {toxinidir}
commands =
{[testenv:sdist]commands}
twine upload dist/*.zip