forked from OpenCyphal/nunavut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
231 lines (188 loc) · 4.78 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#
# The standard version to develop against is 3.11.
#
[tox]
envlist = {py38,py39,py310,py311,py312}-{test,nnvg,doctest,rstdoctest},lint,report,docs
[base]
deps =
Sybil
pytest
pytest-timeout
coverage
types-PyYAML
[dev]
deps =
{[base]deps}
autopep8
rope
isort
nox
# +---------------------------------------------------------------------------+
# | CONFIGURATION
# +---------------------------------------------------------------------------+
[pylint]
max-line-length = 120
max-args = 8
max-attributes = 12
ignore-paths = .*/(jinja2|markupsafe)/.*
min-public-methods = 0
source-roots = src
disable = no-else-return,invalid-name
[pytest]
log_file = pytest.log
log_level = DEBUG
log_cli = true
log_cli_level = WARNING
norecursedirs = submodules .* build* verification {toxworkdir}
addopts = -p no:doctest
[coverage:run]
data_file = build/coverage-py/.coverage
branch=True
parallel=True
relative_files = True
include =
src/nunavut/*
{toxworkdir}/*/site-packages/nunavut/*
omit =
*/jinja2/*
*/markupsafe/*
*/setup.py
*/conf.py
*/embed_jinja.py
[coverage:paths]
source =
src
{toxworkdir}/*/site-packages
{toxworkdir}/*/bin
[coverage:report]
exclude_also =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
assert False
if False:
if __name__ == .__main__.:
omit = *.j2
[doc8]
max-line-length = 120
verbose = 1
[mypy]
# Python version is not specified to allow checking against different versions
warn_return_any = True
warn_unused_configs = True
disallow_untyped_defs = True
check_untyped_defs = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
show_error_context = True
mypy_path = src
exclude = (jinja2|markupsafe)
[mypy-pydsdl]
ignore_missing_imports = True
[mypy-nunavut.jinja.jinja2.*]
follow_imports = skip
[mypy-pytest.*]
ignore_missing_imports = True
[mypy-sybil.*]
ignore_missing_imports = True
[mypy-setuptools.*]
ignore_missing_imports = True
[mypy-importlib_resources.*]
ignore_missing_imports = True
# +---------------------------------------------------------------------------+
# | TOX ENVIRONMENTS
# +---------------------------------------------------------------------------+
[testenv]
usedevelop = true
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONPATH={toxinidir}/test
passenv =
GITHUB
GITHUB_*
deps =
test,nnvg,doctest,rstdoctest: {[base]deps}
commands =
nnvg: coverage run \
nnvg: -m nunavut \
nnvg: -O {envtmpdir} \
nnvg: --target-language cpp \
nnvg: --experimental-languages \
nnvg: --language-standard c++17-pmr \
nnvg: -v \
nnvg: {toxinidir}/submodules/public_regulated_data_types/uavcan
test: coverage run \
test: -m pytest {posargs} --basetemp={envtmpdir} -p "no:cacheprovider" \
test: --junit-xml={envtmpdir}/xunit-result.xml \
test: --rootdir={toxinidir} \
test: {toxinidir}/test
doctest: coverage run \
doctest: -m pytest {posargs} --basetemp={envtmpdir} -p "no:cacheprovider" \
doctest: --rootdir={toxinidir} \
doctest: {toxinidir}/src
rstdoctest: pytest {posargs} --basetemp={envtmpdir} -p "no:cacheprovider" \
rstdoctest: --rootdir={toxinidir} \
rstdoctest: {toxinidir}/docs
[testenv:docs]
deps =
-rrequirements.txt
sphinx
readthedocs-sphinx-ext
commands =
sphinx-build -W -b html {toxinidir} {envtmpdir}
[testenv:report]
deps = coverage
skip_install = true
commands =
coverage combine --append
coverage html -d {envtmpdir}
coverage xml -o {envtmpdir}/coverage.xml
[testenv:lint]
basepython = python3.11
deps =
{[dev]deps}
black
pylint
doc8
Pygments
mypy
lxml
types-pkg_resources
types-PyYAML
commands =
pylint --reports=y \
--rcfile={toxinidir}/tox.ini \
--output={envtmpdir}/pylint.txt \
--output-format=json2 \
--clear-cache-post-run=y \
--confidence=HIGH \
{toxinidir}/src/nunavut
black --check --line-length 120 --force-exclude '(/jinja2/|/markupsafe\/)' src
doc8 {toxinidir}/docs
mypy -p nunavut \
--cache-dir {envtmpdir} \
--txt-report {envtmpdir}/mypy-report-lib \
--config-file {toxinidir}/tox.ini
[testenv:package]
deps =
wheel
twine
commands =
python setup.py \
sdist -d {toxworkdir}/package/dist \
bdist_wheel -d {toxworkdir}/package/dist \
-b {envtmpdir}/tmp \
-k \
--build-number {env:GITHUB_RUN_ID:0}
twine check {toxworkdir}/package/dist/*
[testenv:local]
usedevelop = true
deps =
{[base]deps}
{[dev]deps}
{[testenv:docs]deps}
{[testenv:lint]deps}
commands =
python --version