-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtox.ini
154 lines (132 loc) · 3.5 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# https://tox.wiki/en/latest/config.html#tox-global-settings
# https://pytest-cov.readthedocs.io/en/latest/config.html
# https://docs.pytest.org/en/6.2.x/reference.html?highlight=command%20line%20options#command-line-flags
# https://tox.wiki/en/latest/config.html#tox-environments
# Configuration of tox command.
[tox]
envlist =
check
py{37,38,39,310}
minversion = 3.20
skip_missing_interpreters = true
# Storage space for reusable configuration variables.
[develop_common]
basepython = python3.8
common_env_vars =
# https_proxy = http://
# http_proxy = http://
PYTHONPATH = {toxinidir}/tests
PYTHONUNBUFFERED = yes
# Shared environment configuration.
[testenv]
setenv =
{[develop_common]common_env_vars}
passenv = *
recreate = false
skip_install = false
usedevelop = true
# Run pytest test suite and generate coverage report.
[testenv:py{37,38,39,310}]
setenv =
{[develop_common]common_env_vars}
deps =
-r requirements.txt
-r requirements-min.txt
-r requirements-test.txt
commands =
coverage erase
pytest --cov --cov-report=term-missing:skip-covered \
-v tests {posargs}
coverage html --dir="{toxinidir}/coverage/{envname}_htmlcov"
[testenv:benchmark]
setenv =
{[develop_common]common_env_vars}
basepython = python3.9
deps =
-r requirements.txt
-r requirements-min.txt
-r requirements-test.txt
commands =
pytest -rP tests --benchmark -k gpu
pytest -rP tests --benchmark -k cpu
# Perform mypy static type check on codebase generate report from results.
[testenv:mypy]
recreate = false
skip_install = true
basepython = {[develop_common]basepython}
setenv =
{[develop_common]common_env_vars}
deps =
-r requirements-test.txt
-r requirements-min.txt
-r requirements.txt
commands =
mypy --html-report "{toxinidir}/typechecking/{envname}_report" source/nneve
# Build distribution packages for all supported python versions.
[testenv:build-all]
recreate = true
skip_install = true
ignore_errors = true
deps =
tox>=3.20
commands =
tox -e build-py37 -- --skip
tox -e build-py38 -- --skip
tox -e build-py39 -- --skip
tox -e build-py310 -- --skip
# Build distribution package for single python version x.y
[testenv:build-py{37,38,39,310}]
recreate = true
skip_install = true
deps =
-r requirements-min.txt
commands =
python setup.py bdist_wheel sdist --formats=gztar
# python setup.py sdist --formats=gztar,zip bdist_wheel --universal --python-tag py3.9
# Create virtual envirionment with development utilities.
[testenv:devenv]
setenv =
{[develop_common]common_env_vars}
basepython = {[develop_common]basepython}
recreate = true
skip_install = false
deps =
-r requirements-dev.txt
commands =
pre-commit install
pre-commit install-hooks
# Build documentation web page with MKDocs.
[testenv:docs]
basepython = python3.9
recreate = true
skip_install = false
ignore_errors = false
deps =
-r requirements-docs.txt
-r requirements.txt
commands =
mkdocs build
[testenv:docs-deploy]
basepython = python3.9
recreate = true
skip_install = false
ignore_errors = false
deps =
-r requirements-docs.txt
-r requirements.txt
commands =
mkdocs gh-deploy --force
# Perform code quality check over codespace
[testenv:check]
basepython = {[develop_common]basepython}
recreate = false
skip_install = true
ignore_errors = false
ignore_outcome = false
deps =
-r requirements-min.txt
-r requirements-check.txt
commands =
pre-commit install
pre-commit install-hooks
pre-commit run --all-files