-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtox.ini
199 lines (158 loc) · 4.04 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
#
# We test nanaimo using python 3.7 - 3.8.
#
# The standard version to develop against is 3.7.
#
[tox]
envlist = lint,mypy,{py35,py36,py37,py38}-{test,nait},report,docs,package
[base]
deps =
pyserial
pytest_asyncio
pytest-timeout
Sybil
coverage
[pytest]
log_cli = true
log_cli_level = DEBUG
log_format = %(asctime)s %(levelname)s %(name)s: %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
[mypy]
ignore_missing_imports = True
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
[mypy-serial]
ignore_missing_imports = True
[flake8]
max-complexity = 10
max-line-length = 120
doctests = True
statistics = True
show-source = True
[doc8]
max-line-length = 120
[testenv]
usedevelop = true
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONPATH={toxinidir}/test
passenv =
BUILDKITE
BUILDKITE_*
PYPI_PASSWORD
SONARQUBE_TOKEN
NANAIMO_MAJOR_MINOR_VERSION
NANAIMO_FULL_VERSION
deps =
test,nait: {[base]deps}
commands =
test: coverage run --rcfile={toxinidir}/setup.cfg -m pytest {posargs} -s --basetemp={envtmpdir} -p "no:cacheprovider" --junitxml={envtmpdir}/xunit-result.xml --rootdir={toxinidir}
nait: coverage run --rcfile={toxinidir}/setup.cfg -m nanaimo --version
nait: coverage run --rcfile={toxinidir}/setup.cfg -m nanaimo --help
[testenv:docs]
basepython = python3.7
deps = -rrequirements.txt
commands =
sphinx-build -W -b html . {envtmpdir}
[testenv:report]
deps = coverage
skip_install = true
commands =
coverage combine --append --rcfile={toxinidir}/setup.cfg
coverage html -i --rcfile={toxinidir}/setup.cfg -d {envtmpdir}
coverage xml -i --rcfile={toxinidir}/setup.cfg -o {envtmpdir}/coverage.xml
[testenv:mypy]
basepython = python3.7
deps =
mypy
lxml
changedir = src
skip_install = true
commands =
mypy -m nanaimo \
--cache-dir {envtmpdir} \
--txt-report {envtmpdir}/mypy-report-lib \
--config-file {toxinidir}/tox.ini
[testenv:lint]
basepython = python3.7
skip_install = true
deps =
flake8
doc8
pygments
rstcheck
changedir = src
commands =
flake8 --benchmark \
--tee \
--output-file={envtmpdir}/flake8.txt \
--filename=*.py \
--config={toxinidir}/tox.ini
doc8 --config={toxinidir}/tox.ini \
{toxinidir}/docs
doc8 --config={toxinidir}/tox.ini \
--ignore-path=nanaimo.egg-info \
{toxinidir}/src
[testenv:package]
basepython = python3.7
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:BUILDKITE_BUILD_NUMBER:0}
twine check {toxworkdir}/package/dist/*
[testenv:sonar]
basepython = python3.7
whitelist_externals = sonar-scanner
commands=
sonar-scanner \
-Dsonar.login={env:SONARQUBE_TOKEN:} \
-Dsonar.buildString={env:BUILDKITE_BUILD_NUMBER:0} \
-Dsonar.projectVersion={env:NANAIMO_MAJOR_MINOR_VERSION:0}
[testenv:upload]
basepython = python3.7
skip_install = true
deps =
twine
commands =
twine upload -u __token__ -p {env:PYPI_PASSWORD:} {toxworkdir}/package/dist/*
[testenv:autoformat]
deps =
autopep8
isort
commands =
autopep8 --in-place \
--recursive \
--global-config {toxinidir}/tox.ini \
-a -a -a \
{posargs} \
{toxinidir}/src
autopep8 --in-place \
--recursive \
--global-config {toxinidir}/tox.ini \
-a -a -a \
{posargs} \
{toxinidir}/test
isort -y
[testenv:local]
deps =
{[base]deps}
{[testenv:autoformat]deps}
{[testenv:lint]deps}
{[testenv:docs]deps}
{[testenv:mypy]deps}
rope
commands =
python --version