wandb
/
tox.ini
321 строка · 9.8 Кб
1[tox]
2minversion=4.5.1
3envlist=greet
4
5[testenv]
6package = wheel
7wheel_build_env = .pkg
8
9[testenv:greet]
10skip_install=true
11commands=
12python -c "print('\nGreetings, wandb developer!\\nTo execute a tox environment, run `tox run -e <envname>`\n')"
13
14[black]
15deps=
16black[jupyter]==23.3.0
17
18[testenv:black{,-check}]
19basepython=python3.9
20skip_install=true
21deps=
22{[black]deps}
23commands=
24check: black --check wandb/ tests/ tools/
25!{check}: black {posargs:} wandb/ tests/ tools/
26
27[testenv:mypy{,-report}]
28basepython=python3
29skip_install=true
30deps=
31!{report}: types-click
32!{report}: pandas-stubs
33!{report}: types-Pillow
34!{report}: types-PyYAML
35!{report}: types-Pygments
36!{report}: types-protobuf==4.24.0.4
37!{report}: types-pytz
38!{report}: types-requests
39!{report}: types-setuptools
40!{report}: types-six
41!{report}: types-tqdm
42!{report}: types-openpyxl
43!{report}: mypy
44!{report}: lxml
45!{report}: grpcio
46!{report}: httpx
47report: pycobertura
48setenv=
49!{report}: MYPYPATH={toxinidir}
50commands=
51!{report}: mypy --install-types --non-interactive --show-error-codes --config-file {toxinidir}/pyproject.toml -p wandb --html-report mypy-results/ --cobertura-xml-report mypy-results/ --lineprecision-report mypy-results/
52report: pycobertura show --format text mypy-results/cobertura.xml
53
54[testenv:ruff{,-check}]
55basepython=python3
56skip_install=true
57deps=
58ruff
59commands=
60check: ruff check {toxinidir}
61!{check}: ruff {posargs:} {toxinidir}
62
63[testenv:auto-codegen{,-check}]
64basepython=python3
65deps=
66{[black]deps}
67commands=
68check: python tools{/}generate-tool.py --check
69!{check}: python tools{/}generate-tool.py --generate {posargs:}
70
71[base]
72deps=
73-r{toxinidir}/requirements_test.txt
74-r{toxinidir}/requirements_tools.txt
75!{notebooks}: -r{toxinidir}/requirements_dev.txt
76notebooks: nbclient
77notebooks: nbconvert
78notebooks: nbformat
79notebooks: ipykernel
80notebooks: ipython<8.17.1
81setenv=
82; Setting low network buffer so that we exercise flow control logic
83WANDB__NETWORK_BUFFER=1000
84COVERAGE_FILE={envdir}/.coverage
85YEA_WANDB_VERSION=0.9.20
86passenv=
87USERNAME
88CI_PYTEST_SPLIT_ARGS
89
90[testenv:{,core-}{,notebooks-,importer-wandb-,importer-mlflow-}py{37,38,39,310,311,312}]
91install_command=
92; pytorch installations on non-darwin need the `-f`
93pip install --timeout 600 --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
94deps=
95{[base]deps}
96!py37-!mlflow: .[reports]
97!py37-!mlflow: polyfactory
98wheel
99build
100nox
101importer-mlflow: pydantic<2
102importer-wandb: pydantic>=2
103importer: polars
104importer: rich
105importer: filelock
106setenv=
107{[base]setenv}
108WINDIR=C:\\Windows
109GOCOVERDIR={tox_root}/.coverage
110WANDB_ERROR_REPORTING=false
111passenv=
112{[base]passenv}
113CI_PYTEST_PARALLEL
114CI
115importer-wandb: WANDB_TEST_SERVER_URL2
116allowlist_externals=
117mkdir
118nox
119go
120./wini
121commands_pre=
122notebooks: ipython kernel install --user --name=wandb_python
123mkdir -p test-results .coverage
124core: ./wini package wandb-core --coverage --install
125commands=
126pytest {env:CI_PYTEST_SPLIT_ARGS:} -n=8 --durations=20 --junitxml=test-results/junit.xml --cov --cov-report=xml --no-cov-on-fail --timeout 300 {posargs}
127commands_post=
128core: go tool covdata textfmt -i=.coverage -o coverage.txt
129
130
131[testenv:launch-release]
132deps=
133pytest
134wandb
135wandb[launch]
136commands=
137wandb login
138pytest tests/release_tests/test_launch/ {posargs}
139
140[testenv:func-{,core-}{base-,mitm-,docs-}py{37,38,39,310,311,312}]
141install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
142deps =
143yea-wandb=={env:YEA_WANDB_VERSION}
144core: wheel
145core: build
146core: nox
147core: rich
148setenv=
149{[base]setenv}
150YEACOV_SOURCE={envsitepackagesdir}/wandb/
151core: GOCOVERDIR={tox_root}/.go-coverage
152WANDB_ERROR_REPORTING=false
153passenv=
154{[base]passenv}
155SHARD
156WANDB_API_KEY
157core: GOCOVERDIR
158allowlist_externals=
159mkdir
160core: nox
161core: go
162core: ./wini
163commands_pre=
164mkdir -p test-results
165core: mkdir -p {env:GOCOVERDIR}
166core: ./wini package wandb-core --coverage --install
167commands=
168base: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --shard {env:SHARD:default} --mitm run {posargs:--all}
169mitm: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --shard mitm --mitm run {posargs:tests/standalone_tests}
170docs: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --shard docs --mitm --yeadoc run {posargs:tests/functional_tests}
171commands_post=
172core: go tool covdata textfmt -i={env:GOCOVERDIR} -o coverage.txt
173
174
175[testenv:func-{llm,kfp}-py{37,38,39,310,311,312}]
176install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
177deps=
178yea-wandb=={env:YEA_WANDB_VERSION}
179setenv=
180{[base]setenv}
181YEACOV_SOURCE={envsitepackagesdir}/wandb/
182kfp: WB_PROBE_PACKAGE=true
183WANDB_ERROR_REPORTING=false
184passenv=
185{[base]passenv}
186; llm: WANDB_API_KEY
187llm: OPENAI_API_KEY
188llm: CO_API_KEY
189allowlist_externals=
190mkdir
191commands_pre=
192mkdir -p test-results
193; llm: wandb login --relogin {env:WANDB_API_KEY}
194commands=
195; 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}
196llm: yea {env:CI_PYTEST_SPLIT_ARGS:} --strict --shard llm run {posargs:--all}
197kfp: 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}
198
199[testenv:standalone-{local,cpu,gpu,tpu}-py{37,38,39,310,311,312}]
200install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
201setenv=
202{[base]setenv}
203YEACOV_SOURCE={envsitepackagesdir}/wandb/
204WANDB_PROJECT=standalone-{env:DATE}
205WANDB_ERROR_REPORTING=false
206passenv=
207DATE
208USERNAME
209WANDB_API_KEY
210SHARD
211deps=
212yea-wandb=={env:YEA_WANDB_VERSION}
213wheel
214build
215nox
216rich
217allowlist_externals=
218mkdir
219nox
220go
221./wini
222commands_pre=
223wandb login --relogin {env:WANDB_API_KEY}
224./wini package wandb-core --coverage --install
225commands=
226mkdir -p test-results
227!{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}
228local: 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}
229
230[testenv:regression-{yolov5,huggingface,keras,tensorflow,pytorch,wandb-sdk-standalone,wandb-sdk-examples,wandb-sdk-other,s3,sagemaker}-py{37,38,39,310,311,312}]
231install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
232deps=
233pyyaml
234six
235wandb
236shortuuid
237setenv=
238{[base]setenv}
239WANDB_ERROR_REPORTING=false
240passenv=*
241allowlist_externals=
242git
243rm
244env
245changedir=
246{envdir}
247commands_pre=
248rm -rf wandb-testing
249git clone https://github.com/wandb/wandb-testing.git
250commands=
251yolov5: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/yolov5/ {posargs}"
252huggingface: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/huggingface/ {posargs}"
253keras: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/keras/ {posargs}"
254tensorflow: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/tensorflow/ {posargs}"
255pytorch: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/pytorch/ {posargs}"
256wandb-sdk-standalone: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/wandb-git/client/standalone_tests/ {posargs}"
257wandb-sdk-examples: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/wandb-git/examples/ {posargs}"
258wandb-sdk-other: env bash -c "./wandb-testing/regression/do-cloud-regression.sh tests/main/wandb-git/wandb-examples/ {posargs}"
259sagemaker: env bash -c "./wandb-testing/regression/do-sagemaker-regression.sh tests/sagemaker-beta/ {posargs}"
260s3: env bash -c "./wandb-testing/regression/do-s3-regression.sh tests/s3-beta/ {posargs}"
261
262[testenv:executor-{pex,uwsgi,gunicorn}]
263install_command=pip install --extra-index-url https://download.pytorch.org/whl/cpu {opts} {packages}
264basepython=python3.9
265deps=
266{uwsgi,gunicorn}: flask
267gunicorn: gunicorn
268uwsgi: uwsgi
269pex: pex
270setenv=
271{[base]setenv}
272WANDB_ERROR_REPORTING=false
273passenv=*
274allowlist_externals=
275bash
276commands=
277bash tests/standalone_tests/executor_tests/{envname}.sh {posargs}
278
279[testenv:cover{,-func}-{linux,mac,win}{,-circle}]
280skip_install=true
281basepython=python3
282deps=
283coverage[toml]
284setenv=
285circle: CIRCLE_BUILD_NUM={env:CIRCLE_WORKFLOW_ID}
286passenv=
287circle: CI
288circle: CIRCLECI
289circle: CIRCLE_*
290circle: CODECOV_*
291COVERAGE_DIR
292allowlist_externals=
293mkdir
294cp
295!{win}: env
296commands=
297mkdir -p cover-results
298!{win}: env bash -c '{envpython} -m coverage combine {toxworkdir}/{env:COVERAGE_DIR}/.coverage*'
299!{win}: env bash -c '{envpython} -m coverage xml --ignore-errors'
300win: {envpython} -m coverage combine '{toxworkdir}\\{env:COVERAGE_DIR}\\.coverage'
301win: {envpython} -m coverage xml --ignore-errors
302
303cp .coverage coverage.xml cover-results/
304!{win}: coverage report --rcfile=.coveragerc
305win: {envpython} -m coverage report --rcfile=.coveragerc
306
307[testenv:pod-store]
308allowlist_externals=
309mkdir
310cp
311commands=
312mkdir -p /wandb-store/test-results
313cp -rp test-results /wandb-store/test-results
314
315[testenv:bumpversion]
316basepython=python3
317skip_install=true
318deps=
319bump2version
320commands=
321python ./tools/bumpversion-tool.py {posargs:--to-dev }
322