forked from girder/girder
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtox.ini
More file actions
277 lines (260 loc) · 6.93 KB
/
Copy pathtox.ini
File metadata and controls
277 lines (260 loc) · 6.93 KB
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 = lint,web-lint,docs,public-names,web-test,pytest,legacy-test,integration-test,coverage
setenv =
PIP_PROGRESS_BAR = off
PIP_DISABLE_PIP_VERSION_CHECK = 1
[testenv:pytest]
passenv =
DOCKER_HOST
deps =
-rrequirements-dev.txt
commands =
python {toxinidir}/.circleci/build_plugins.py {toxinidir}/plugins --extra {toxinidir} --extra {toxinidir}/girder/web --extra {toxinidir}/girder/web/fontello
pytest --forked {posargs}
[testenv:lint]
skip_install = true
skipsdist = true
deps =
flake8
flake8-bugbear
flake8-docstrings
flake8-quotes
pep8-naming
commands =
flake8 {posargs}
[testenv:format]
skip_install = true
skipsdist = true
deps =
autopep8
unify
commands =
autopep8 -ria .
unify --in-place --recursive .
[testenv:docs]
# readthedocs.org runs "python setup.py install" (which installs no dependencies). With the
# limitations of Tox (not being able to use a different install_command for deps installation and
# package installation) and the desire to install cleanly via pip (instead of directly with
# setuptools), skip_install and an explicit "pip install" run command seems to be the best
# configuration possible.
skip_install = true
skipsdist = true
# Building docs has a direct dependency on Sphinx. Documentation dependencies are listed in a
# separate file to allow readthedocs.org to read and install them.
deps =
-rdocs/requirements-docs.txt
setenv =
{[tox]setenv}
GIRDER_SPHINX_BUILD = true
commands =
pip install \
--editable . \
--editable clients/python \
--editable ./worker
sphinx-build \
--quiet \
--fail-on-warning \
--builder html \
--doctree-dir {envtmpdir}/doctrees \
docs build/docs/html
[testenv:coverage]
skip_install = true
skipsdist = true
deps =
coverage
commands =
coverage combine
coverage report
coverage html
coverage xml
[testenv:publish]
allowlist_externals =
{toxinidir}/.circleci/publish_pypi.sh
skip_install = true
skipsdist = true
passenv =
CIRCLE_BRANCH
TWINE_USERNAME
TWINE_PASSWORD
deps =
build
setuptools-scm
twine
commands =
{toxinidir}/.circleci/publish_pypi.sh upload
[testenv:check-publish]
allowlist_externals =
{toxinidir}/.circleci/publish_pypi.sh
skip_install = true
skipsdist = true
passenv =
CIRCLE_BRANCH
TWINE_USERNAME
TWINE_PASSWORD
deps =
build
setuptools-scm
twine
commands =
{toxinidir}/.circleci/publish_pypi.sh check
[testenv:public-names]
allowlist_externals =
{toxinidir}/scripts/test_names.sh
commands =
{toxinidir}/scripts/test_names.sh
[testenv:public-names-update]
allowlist_externals =
bash
commands =
bash -c 'python {toxinidir}/scripts/publicNames.py > {toxinidir}/scripts/publicNames.txt'
[testenv:pytest_circleci]
passenv =
DOCKER_HOST
deps =
{[testenv:pytest]deps}
commands =
coverage erase
pytest \
--tb=long \
--junit-xml="build/test/results/pytest.xml" \
--cov \
--cov-append \
--cov-report="" \
--keep-db \
--forked \
{posargs}
[testenv:web-lint]
description = Run Javascript linting
skip_install = true
skipsdist = true
allowlist_externals =
npm
commands =
npm ci
npm run lint
[testenv:web-format]
description = Run Javascript linting fixes
skip_install = true
skipsdist = true
allowlist_externals =
npm
commands =
npm ci
npm run format
[testenv:web-test]
description = Run web client (Playwright) tests
deps =
{[testenv:pytest]deps}
changedir = {toxinidir}/girder/web
allowlist_externals =
npm
npx
passenv = *
commands =
pip install -e {toxinidir}
python {toxinidir}/.circleci/build_plugins.py {toxinidir}/plugins --extra {toxinidir} --extra {toxinidir}/girder/web --extra {toxinidir}/girder/web/fontello
npm ci
npm run build
npx playwright install chromium firefox
npm run test -- "{posargs}"
[testenv:legacy-test]
description = Run legacy CTest-based python tests
deps =
{[testenv:pytest]deps}
passenv = *
setenv =
CTEST_SOURCE_DIRECTORY = {toxinidir}
CTEST_BINARY_DIRECTORY = {toxinidir}/build/legacy
TEST_GROUP = python
PYTHON_VERSION = 3.10
PYTHON_EXECUTABLE = {envpython}
allowlist_externals =
ctest
commands =
python {toxinidir}/.circleci/build_plugins.py {toxinidir}/plugins --extra {toxinidir} --extra {toxinidir}/girder/web --extra {toxinidir}/girder/web/fontello
ctest \
--extra-verbose \
--script "{toxinidir}/.circleci/ci_test.cmake" \
--exclude-regex "^server_pytest_core$"
[testenv:integration-test]
description = Run CTest-based integration tests (requires full build)
deps =
{[testenv:pytest]deps}
passenv = *
setenv =
{[tox]setenv}
CTEST_SOURCE_DIRECTORY = {toxinidir}
CTEST_BINARY_DIRECTORY = {toxinidir}/build/integration
PYTHON_VERSION = 3.10
PYTHON_EXECUTABLE = {envpython}
JASMINE_TIMEOUT = 15000
allowlist_externals =
cmake
ctest
npm
commands =
pip install {toxinidir}
python {toxinidir}/.circleci/build_plugins.py {toxinidir}/plugins --extra {toxinidir} --extra {toxinidir}/girder/web --extra {toxinidir}/girder/web/fontello
npm --prefix {toxinidir}/girder/web ci
npm --prefix {toxinidir}/girder/web run build
cmake -B {toxinidir}/build/integration .
cmake --build {toxinidir}/build/integration --parallel 3
ctest --test-dir {toxinidir}/build/integration --parallel 3 \
--extra-verbose --label-regex girder_integration
[flake8]
max-line-length = 100
show-source = True
max-complexity = 14
format = pylint
exclude =
node_modules,
.eggs,
.git,
__pycache__,
.tox
ignore =
B017,
# B019 - Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks.
B019,
# B027 - Consider adding @abstractmethod.
B027,
B042,
# D10 - Missing docstring (errors D100 - D107)
D10,
# D200 - One-line docstrings should fit on one line with quotes.
D200,
# D205 - Blank line required between one-line summary and description.
D205,
# D400 - First line should end with a period.
D400,
# D401 - First line should be in imperative mood.
D401,
# E123 - Closing bracket does not match indentation of opening bracket's line
E123,
# F824 - Name is never used in scope
F824,
N801,
# N802 - Function name should be lowercase.
N802,
# N803 - Argument name should be lowercase.
N803,
# N806 - Variable in function should be lowercase.
N806,
# N812 - Lowercase imported as non lowercase.
N812,
N813,
# N815 - mixedCase variable in class scope
N815,
# N816 - mixedCase variable in global scope
N816,
# N818 - error suffix in exception name
N818,
# Q003 - Change outer quotes to avoid escaping inner quotes
Q003,
# W503 - Line break occurred before a binary operator
W503,
[pytest]
addopts = --verbose --strict --showlocals
cache_dir = build/test/pytest_cache
junit_family = xunit2
testpaths = test