forked from wandb/wandb
-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
346 lines (322 loc) · 11 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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
[tox]
minversion=4.5.1
envlist=greet
[testenv]
package = wheel
wheel_build_env = .pkg
[testenv:greet]
skip_install=true
commands=
python -c "print('\nGreetings, wandb developer!\\nTo execute a tox environment, run `tox run -e <envname>`\n')"
[black]
deps=
black[jupyter]==23.3.0
[testenv:black{,-check}]
basepython=python3.9
skip_install=true
deps=
{[black]deps}
commands=
check: black --check wandb/ tests/ tools/
!{check}: black {posargs:} wandb/ tests/ tools/
[testenv:mypy{,-report}]
basepython=python3
skip_install=true
deps=
!{report}: types-click==7.1.8
!{report}: mypy<1.4.0
!{report}: lxml
!{report}: grpcio
!{report}: httpx
report: pycobertura
setenv=
!{report}: MYPYPATH={toxinidir}
commands=
!{report}: mypy --install-types --non-interactive --show-error-codes --config-file {toxinidir}/mypy.ini -p wandb --html-report mypy-results/ --cobertura-xml-report mypy-results/ --lineprecision-report mypy-results/
report: pycobertura show --format text mypy-results/cobertura.xml
[testenv:ruff{,-check}]
basepython=python3
skip_install=true
deps=
ruff
commands=
check: ruff check {toxinidir}
!{check}: ruff {posargs:} {toxinidir}
[testenv:codecov{,-check}]
basepython=python3
skip_install=true
deps=
pyyaml
allowlist_externals=
env
commands_pre=
env bash -c "curl -fLSs https://circle.ci/cli | bash"
commands=
check: python tools{/}coverage-tool.py check
!{check}: python tools{/}coverage-tool.py {posargs:}
[testenv:proto{3,4}{,-check}]
basepython=python3.9
allowlist_externals=
check: cp
check: rm
check: diff
deps=
proto3: mypy-protobuf==3.3.0
proto3: grpcio==1.46.3
proto3: grpcio-tools==1.46.3
proto4: mypy-protobuf==3.4.0
proto4: grpcio==1.50.0
proto4: grpcio-tools==1.50.0
changedir={toxinidir}/wandb/proto
commands_pre=
check: rm -rf {toxinidir}/wandb/proto_check
proto3-check: cp -r {toxinidir}/wandb/proto/v3 {toxinidir}/wandb/proto_check
proto4-check: cp -r {toxinidir}/wandb/proto/v4 {toxinidir}/wandb/proto_check
commands=
python wandb_internal_codegen.py
commands_post=
proto3-check: diff {toxinidir}/wandb/proto/v3 {toxinidir}/wandb/proto_check/
proto4-check: diff {toxinidir}/wandb/proto/v4 {toxinidir}/wandb/proto_check/
[testenv:auto-codegen{,-check}]
basepython=python3
deps=
{[black]deps}
commands=
check: python tools{/}generate-tool.py --check
!{check}: python tools{/}generate-tool.py --generate {posargs:}
[base]
deps=
-r{toxinidir}/requirements_test.txt
!{notebooks}: -r{toxinidir}/requirements_dev.txt
notebooks: nbclient
notebooks: nbconvert
notebooks: nbformat
notebooks: ipykernel
notebooks: ipython
setenv=
; Setting low network buffer so that we exercise flow control logic
WANDB__NETWORK_BUFFER=1000
COVERAGE_FILE={envdir}/.coverage
YEA_WANDB_VERSION=0.9.15
passenv=
USERNAME
CI_PYTEST_SPLIT_ARGS
[testenv:{,notebooks-}py{37,38,39,310,311}]
install_command=
; pytorch installations on non-darwin need the `-f`
pip install --timeout 600 --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
deps=
{[base]deps}
setenv=
{[base]setenv}
WINDIR=C:\\Windows
passenv=
{[base]passenv}
CI_PYTEST_PARALLEL
CI
allowlist_externals=
mkdir
echo
commands_pre=
notebooks: ipython kernel install --user --name=wandb_python
commands=
mkdir -p test-results
!{notebooks}: pytest {env:CI_PYTEST_SPLIT_ARGS:} -n={env:CI_PYTEST_PARALLEL:{env:WB_UNIT_PARALLEL:10}} --durations=20 --reruns 3 --reruns-delay 1 --junitxml=test-results/junit.xml --cov-config=.coveragerc --cov --cov-report= --no-cov-on-fail --timeout 300 {posargs:tests/pytest_tests/}
notebooks: pytest {env:CI_PYTEST_SPLIT_ARGS:} -n={env:CI_PYTEST_PARALLEL:{env:WB_UNIT_PARALLEL:10}} --durations=20 --reruns 3 --reruns-delay 1 --junitxml=test-results/junit.xml --cov-config=.coveragerc --cov --cov-report= --no-cov-on-fail --timeout 300 {posargs:tests/pytest_tests/system_tests/test_notebooks}
[testenv:launch-release]
deps=
pytest
wandb
wandb[launch]
commands=
wandb login
pytest tests/release_tests/test_launch/ {posargs}
[func-win32-hack]
deps=
tqdm
!{noml}: torch
cloudpickle
pillow
!{noml}: tensorflow
lightgbm
scikit-learn
xgboost>=1.3.0
[testenv:func-{,grpc-,docs-,noml-,}py{37,38,39,310,311}]
install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
deps =
yea-wandb=={env:YEA_WANDB_VERSION}
; {[func-win32-hack]deps}
setenv=
{[base]setenv}
YEACOV_SOURCE={envsitepackagesdir}/wandb/
passenv=
{[base]passenv}
SHARD
extras=
grpc: grpc
allowlist_externals=
mkdir
commands_pre=
mkdir -p test-results
commands=
!{docs}: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --shard {env:SHARD:default} run {posargs:--all}
docs: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --yeadoc --shard docs run {posargs:--all}
[testenv:func-mitm-py{37,38,39,310}]
install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
deps =
yea-wandb=={env:YEA_WANDB_VERSION}
setenv=
{[base]setenv}
YEACOV_SOURCE={envsitepackagesdir}/wandb/
passenv=
{[base]passenv}
WANDB_API_KEY
allowlist_externals=
mkdir
commands_pre=
mkdir -p test-results
commands=
yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --shard mitm --mitm run {posargs:--all}
[testenv:func-{llm,kfp}-py{37,38,39,310,311}]
install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
deps=
yea-wandb=={env:YEA_WANDB_VERSION}
setenv=
{[base]setenv}
YEACOV_SOURCE={envsitepackagesdir}/wandb/
kfp: WB_PROBE_PACKAGE=true
passenv=
{[base]passenv}
; llm: WANDB_API_KEY
llm: OPENAI_API_KEY
llm: CO_API_KEY
allowlist_externals=
mkdir
commands_pre=
mkdir -p test-results
; llm: wandb login --relogin {env:WANDB_API_KEY}
commands=
; llm: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict -p wandb:mockserver-relay=true -p wandb:mockserver-relay-remote-base-url=https://api.wandb.ai --shard llm run {posargs:--all}
llm: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --shard llm run {posargs:--all}
kfp: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict -p wandb:mockserver-bind=0.0.0.0 -p wandb:mockserver-host=__auto__ --shard kfp run {posargs:--all}
[testenv:standalone-{local,cpu,gpu,tpu}-py{37,38,39,310,311}]
install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
setenv=
{[base]setenv}
YEACOV_SOURCE={envsitepackagesdir}/wandb/
WANDB_PROJECT=standalone-{env:DATE}
passenv=
DATE
USERNAME
WANDB_API_KEY
SHARD
deps=
yea-wandb=={env:YEA_WANDB_VERSION}
allowlist_externals=
mkdir
commands_pre=
wandb login --relogin {env:WANDB_API_KEY}
commands=
mkdir -p test-results
!{local}: yea --debug --strict -p wandb:mockserver-relay=true -p wandb:mockserver-relay-remote-base-url=https://api.wandb.ai --shard standalone-{env:SHARD:cpu} run {posargs:--all}
local: yea --debug --strict -p wandb:mockserver-bind=0.0.0.0 -p wandb:mockserver-host=__auto__ -p wandb:mockserver-relay=true -p wandb:mockserver-relay-remote-base-url=http://localhost:5000 --shard standalone-cpu run {posargs:--all}
[testenv:regression-{yolov5,huggingface,keras,tensorflow,pytorch,wandb-sdk-standalone,wandb-sdk-examples,wandb-sdk-other,s3,sagemaker}-py{37,38,39,310,311}]
install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
deps=
pyyaml
six
wandb
shortuuid
setenv=
{[base]setenv}
passenv=*
allowlist_externals=
git
rm
env
changedir=
{envdir}
commands_pre=
rm -rf wandb-testing
git clone https://github.com/wandb/wandb-testing.git
commands=
yolov5: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/yolov5/ {posargs}"
huggingface: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/huggingface/ {posargs}"
keras: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/keras/ {posargs}"
tensorflow: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/tensorflow/ {posargs}"
pytorch: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/pytorch/ {posargs}"
wandb-sdk-standalone: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/wandb-git/client/standalone_tests/ {posargs}"
wandb-sdk-examples: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/wandb-git/examples/ {posargs}"
wandb-sdk-other: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/wandb-git/wandb-examples/ {posargs}"
sagemaker: env bash -c "./wandb-testing/regression/do-sagemaker-regression.sh tests/sagemaker-beta/ {posargs}"
s3: env bash -c "./wandb-testing/regression/do-s3-regression.sh tests/s3-beta/ {posargs}"
[testenv:executor-{pex,uwsgi,gunicorn}]
install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
basepython=python3.9
deps=
{uwsgi,gunicorn}: flask
gunicorn: gunicorn
uwsgi: uwsgi
pex: pex
setenv=
{[base]setenv}
passenv=*
allowlist_externals=
bash
commands=
!{pex}: bash tests/standalone_tests/executor_tests/{envname}.sh {posargs}
pex: bash tests/standalone_tests/executor_tests/{envname}.sh {toxinidir}/requirements.txt {posargs}
[testenv:cover{,-func,-notebooks}-{linux,mac,win}{,-circle}]
skip_install=true
basepython=python3
deps=
!{func}: pytest
coverage
setenv=
circle: CIRCLE_BUILD_NUM={env:CIRCLE_WORKFLOW_ID}
passenv=
circle: CI
circle: CIRCLECI
circle: CIRCLE_*
circle: CODECOV_*
circle: TOXENV
COVERAGE_DIR
allowlist_externals=
mkdir
cp
!{win}: env
circle: curl
circle: chmod
!{win}-circle: ./codecov
win-circle: codecov.exe
commands=
mkdir -p cover-results
!{win}: env bash -c '{envpython} -m coverage combine {toxworkdir}/{env:COVERAGE_DIR}/.coverage*'
!{win}: env bash -c '{envpython} -m coverage xml --ignore-errors'
win: {envpython} -m coverage combine '{toxworkdir}\\{env:COVERAGE_DIR}\\.coverage'
win: {envpython} -m coverage xml --ignore-errors
cp .coverage coverage.xml cover-results/
!{win}: coverage report --rcfile=.coveragerc
win: {envpython} -m coverage report --rcfile=.coveragerc
commands_post=
linux-circle: curl -Os https://uploader.codecov.io/latest/linux/codecov
mac-circle: curl -Os https://uploader.codecov.io/latest/macos/codecov
win-circle: curl -o codecov.exe https://uploader.codecov.io/latest/windows/codecov.exe
!{win}-circle: chmod +x codecov
win-circle: chmod +x codecov.exe
!{win}-circle: ./codecov -e TOXENV -F unittest
win-circle: codecov.exe -e TOXENV -F unittest
[testenv:pod-store]
allowlist_externals=
mkdir
cp
commands=
mkdir -p /wandb-store/test-results
cp -rp test-results /wandb-store/test-results
[testenv:bumpversion]
basepython=python3
skip_install=true
deps=
bump2version
commands=
python ./tools/bumpversion-tool.py {posargs:--to-dev }