-
Notifications
You must be signed in to change notification settings - Fork 39
/
tox.ini
234 lines (215 loc) · 6.48 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
232
233
234
[tox]
envlist =
test-py{36,37,38,39,310}
docs
flake8
lintclient
lintannotationclient
skip_missing_interpreters = true
toxworkdir = {toxinidir}/build/tox
[testenv]
passenv = PYTEST_*
extras =
memcached
setenv =
PIP_FIND_LINKS=https://girder.github.io/large_image_wheels
GDAL_PAM_ENABLED=no
[testenv:test]
description = Run all tests, including Girder
deps =
-rrequirements-dev.txt
coverage
mock
pooch
pymongo<4
pytest>=3.6
pytest-cov>=2.6
pytest-custom-exit-code
pytest-girder>=3.0.4
pytest-xdist
whitelist_externals =
rm
npx
# Run most tests in parallel and conflicting tests sequentially
commands =
rm -rf build/test/coverage/web_temp
girder build --dev
pytest -m 'singular' --cov-config tox.ini --suppress-no-test-exit-code {posargs}
pytest --numprocesses logical -m 'not singular' --cov-config tox.ini --cov-append --suppress-no-test-exit-code {posargs}
- npx nyc report --temp-dir build/test/coverage/web_temp --report-dir build/test/coverage --reporter cobertura --reporter text-summary
# Reduce npm chatter
setenv =
NPM_CONFIG_FUND=false
NPM_CONFIG_AUDIT=false
NPM_CONFIG_AUDIT_LEVEL=high
NPM_CONFIG_LOGLEVEL=warn
NPM_CONFIG_PROGRESS=false
NPM_CONFIG_PREFER_OFFLINE=true
PIP_FIND_LINKS=https://girder.github.io/large_image_wheels
GDAL_PAM_ENABLED=no
[testenv:test-py{36,37,38,39,310}]
deps = {[testenv:test]deps}
whitelist_externals = {[testenv:test]whitelist_externals}
commands = {[testenv:test]commands}
setenv = {[testenv:test]setenv}
[testenv:server]
description = Run all tests except Girder client
deps = {[testenv:test]deps}
commands =
pytest -m 'singular and not girder_client' --cov-config tox.ini --suppress-no-test-exit-code {posargs}
pytest --numprocesses logical -m 'not singular and not girder_client' --cov-config tox.ini --cov-append --suppress-no-test-exit-code {posargs}
[testenv:server-py{36,37,38,39,310}]
deps = {[testenv:server]deps}
commands = {[testenv:server]commands}
# For running just one test, it is often clearer to do
# tox -e <env> -- --numprocesses 0 --no-cov -k <test name>
[testenv:core]
description = Run core tests. This is all but Girder
deps =
-rrequirements-dev-core.txt
coverage
mock
pooch
pytest>=3.6
pytest-cov>=2.6
pytest-custom-exit-code
pytest-xdist
commands =
pytest -m 'singular and not girder' --cov-config tox.ini --suppress-no-test-exit-code {posargs}
pytest --numprocesses logical -m 'not singular and not girder' --cov-config tox.ini --cov-append --suppress-no-test-exit-code {posargs}
[testenv:core-py{36,37,38,39,310}]
deps = {[testenv:core]deps}
commands = {[testenv:core]commands}
[testenv:flake8]
description = Lint python code
skipsdist = true
skip_install = true
deps =
flake8
flake8-bugbear
flake8-docstrings
flake8-isort
flake8-quotes
commands = flake8 {posargs}
[testenv:format]
description = Autoformat import order
skipsdist = true
skip_install = true
deps =
isort
commands =
isort {posargs:.}
[testenv:lintclient]
description = Lint the girder large_image plugin client
skip_install = true
usedevelop = false
deps =
changedir = {toxinidir}/girder/girder_large_image/web_client
whitelist_externals =
npm
commands =
npm install --no-package-lock
npm run lint
[testenv:lintannotationclient]
description = Lint the girder large_image_annotation plugin client
skip_install = true
usedevelop = false
deps =
changedir = {toxinidir}/girder_annotation/girder_large_image_annotation/web_client
whitelist_externals =
npm
commands =
npm install --no-package-lock
npm run lint
[testenv:docs]
description = Build documentation
deps =
-rrequirements-dev.txt
sphinx!=5.1.0
sphinx-rtd-theme
changedir = {toxinidir}/docs
whitelist_externals =
make_docs.sh
commands =
./make_docs.sh
[isort]
line_length = 100
wrap_length = 79
[flake8]
max-line-length = 100
show-source = True
format = pylint
max-complexity = 14
exclude =
build
docs
*/web_client/*
*/*egg*/*
# Ignore missing docstring errors.
ignore = D100,D101,D102,D103,D104,D105,D106,D107,D200,D205,D400,D401,E741,W504
[pytest]
addopts = --verbose --strict-markers --showlocals --cov-report="term" --cov-report="xml" --cov --ignore test/utils
cache_dir = build/pytest_cache
testpaths =
test
girder/test_girder
girder_annotation/test_annotation
markers =
singular: mark a test to run in a non-parallel environment.
girder: mark a test as requiring girder
girder_client: mark a test as requiring girder client
plugin: use by girder to load plugins
# Some of these warnings are filtered by their own packages (e.g., the numpy
# warnings), and pytest shows them anyway unless they are listed here. Others,
# such as the mongo warnings, we can't do anything about as this package has no
# stake in the version of pymongo used by Girder. The setName() deprecation
# will likely become an error in Python 3.11, but we'd expect dependent
# libraries to catch up.
filterwarnings =
ignore::pytest.PytestUnraisableExceptionWarning
ignore:.*count is deprecated.*:DeprecationWarning
ignore::DeprecationWarning:.*mongo.*
ignore::DeprecationWarning:.*cheroot.*
ignore::UserWarning:pymongo.collection
ignore::DeprecationWarning:bioformats.formatreader
ignore:.*numpy.dtype size changed.*
ignore:.*numpy.ufunc size changed.*
ignore:.*numpy.ndarray size changed.*
ignore:.*Unrecognized box.*:UserWarning:glymur.*
ignore:.*SetUnitType.*not supported on this raster band.*
ignore::pytest.PytestUnhandledThreadExceptionWarning:cachetools.*
ignore:::celery.backends.amqp
ignore:Creating a LegacyVersion.*:DeprecationWarning
ignore:setName\(\) is deprecated, set the name attribute instead:DeprecationWarning
[coverage:paths]
# As of pytest-cov 2.6, all but the first source line is relative to the first
# source line. The first line is relative to the local path. Prior to 2.6,
# all lines were relative to the local path.
source =
large_image/
../sources/
../utilities/converter/
../examples/
../girder/girder_large_image
../girder_annotation/girder_large_image_annotation
../utilities/converter/tasks/
../build/tox/*/lib/*/site-packages/large_image/
[coverage:run]
data_file = build/coverage/.coverage
branch = True
omit = test/*
include =
large_image/*
sources/*
utilities/converter/*
examples/*
girder/girder_large_image/*
girder_annotation/girder_large_image_annotation/*
utilities/tasks*
build/tox/*/lib/*/site-packages/*large_image*/*
parallel = True
[coverage:html]
directory = build/artifacts/python_coverage
title = Large image Coverage Report
[coverage:xml]
output = build/test/coverage/py_coverage.xml