forked from girder/large_image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
277 lines (255 loc) · 8.16 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
[tox]
envlist =
test-py{36,37,38,39,310,311}
docs
flake8
lintclient
skip_missing_interpreters = true
toxworkdir = {toxinidir}/build/tox
[testenv]
passenv = PYTEST_*
extras =
memcached
performance
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-test.txt
coverage
mock
pooch
pymongo<4
pytest>=3.6
pytest-cov>=2.6
pytest-custom-exit-code
pytest-girder>=3.0.4
pytest-rerunfailures
pytest-xdist
allowlist_externals =
rm
npx
# Run most tests in parallel and conflicting tests sequentially
commands =
rm -rf build/test/coverage/web_temp
girder build --dev
pytest --numprocesses 1 -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
# Versions that don't have all tile sources
[testenv:test-py{36,37}]
deps = {[testenv:test]deps}
allowlist_externals = {[testenv:test]allowlist_externals}
commands = {[testenv:test]commands}
setenv = {[testenv:test]setenv}
# Versions that do have all tile sources. Using the requirements-dev.txt file
# installs in editable mode, which then includes results in coverage.
[testenv:test-py{38,39,310,311}]
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-rerunfailures
pytest-xdist
allowlist_externals = {[testenv:test]allowlist_externals}
commands = {[testenv:test]commands}
setenv = {[testenv:test]setenv}
[testenv:server]
description = Run all tests except Girder client
deps = {[testenv:test]deps}
commands =
pytest --numprocesses 1 -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,311}]
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-test-core.txt
coverage
mock
pooch
pytest>=3.6
pytest-cov>=2.6
pytest-custom-exit-code
pytest-rerunfailures
pytest-xdist
commands =
pytest --numprocesses 1 -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,311}]
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 and autopep8
skipsdist = true
skip_install = true
deps =
autopep8
isort
unify
commands =
isort {posargs:.}
autopep8 -ria large_image sources utilities girder girder_annotation examples docs test
unify --in-place --recursive large_image sources utilities girder girder_annotation examples docs test
[testenv:lintclient]
description = Lint the girder large_image plugin client
skip_install = true
deps =
allowlist_externals =
npm
commands =
npm --prefix {toxinidir}/girder/girder_large_image/web_client install --no-package-lock
npm --prefix {toxinidir}/girder_annotation/girder_large_image_annotation/web_client install --no-package-lock
npm --prefix {toxinidir}/girder/girder_large_image/web_client run lint
npm --prefix {toxinidir}/girder_annotation/girder_large_image_annotation/web_client run lint
[testenv:formatclient]
description = Autoformat client
skip_install = true
deps =
allowlist_externals =
npm
commands =
npm --prefix {toxinidir}/girder/girder_large_image/web_client install --no-package-lock
npm --prefix {toxinidir}/girder_annotation/girder_large_image_annotation/web_client install --no-package-lock
npm --prefix {toxinidir}/girder/girder_large_image/web_client run format
npm --prefix {toxinidir}/girder_annotation/girder_large_image_annotation/web_client run format
# You can use "tox devenv -e dev <venv path>" to create a development
# environment. This will only work on python base versions that support all
# large_image packages.
[testenv:dev]
description = Setup dev environment
use_develop = true
deps =
-rrequirements-dev.txt
commands =
pip freeze
[testenv:dev-py{36,37,38,39,310,311}]
usedevelop = true
deps = {[testenv:dev]deps}
commands = {[testenv:dev]commands}
[testenv:docs]
description = Build documentation
deps =
-rrequirements-test.txt
sphinx
sphinx-rtd-theme
sphinxcontrib-jquery
changedir = {toxinidir}/docs
allowlist_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,B017
[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