forked from wandb/wandb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
270 lines (245 loc) · 6.13 KB
/
tox.ini
File metadata and controls
270 lines (245 loc) · 6.13 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
[tox]
minversion=3.7
envlist = codemod,black,mypy,flake8,py36,py27,py37,py38,py39,cover
[testenv]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements_dev.txt
pytest
pytest-cov
pytest-xdist
pytest-flask
pytest-mock<=3.2.0
pytest-timeout
pytest-openfiles
pytest-flakefinder
passenv = USERNAME
setenv =
py{27,35,36,37,38}: COVERAGE_FILE={envdir}/.coverage
py{37}: WINDIR=C:\\Windows
# Pytorch installations on non-darwin need the `-f`
whitelist_externals =
mkdir
commands =
py{35,36,37,38}: ipython kernel install --user --name=wandb_python
mkdir -p test-results
python -m pytest --junitxml=test-results/junit.xml --cov-config=tox.ini --cov=wandb --cov=tests/ --cov-report= --no-cov-on-fail --ignore=wandb/sweeps --ignore=build/ {posargs:tests/ wandb/sweeps/}
[testenv:py27]
install_command = pip install -f https://download.pytorch.org/whl/torch_stable.html {opts} {packages}
[testenv:py35]
install_command = pip install -f https://download.pytorch.org/whl/torch_stable.html {opts} {packages}
[testenv:py36]
install_command = pip install -f https://download.pytorch.org/whl/torch_stable.html {opts} {packages}
[testenv:py37]
install_command = pip install -f https://download.pytorch.org/whl/torch_stable.html {opts} {packages}
[testenv:py38]
install_command = pip install -f https://download.pytorch.org/whl/torch_stable.html {opts} {packages}
[testenv:py39]
# install_command = pip install -f https://download.pytorch.org/whl/torch_stable.html {opts} {packages}
[testenv:dev]
usedevelop = true
basepython = python3
commands = ipython
[testenv:codemod]
basepython=python3
skip_install = true
deps =
libcst
commands=
/bin/bash -c './tools/strip_type_annotations.sh'
[testenv:bumpversion-to-dev]
basepython=python3
skip_install = true
deps =
bumpversion==0.5.3
commands=
python ./tools/bumpversion-tool.py --to-dev {posargs}
[testenv:bumpversion-from-dev]
basepython=python3
skip_install = true
deps =
bumpversion==0.5.3
commands=
python ./tools/bumpversion-tool.py --from-dev {posargs}
[testenv:codemodcheck]
basepython=python3
skip_install = true
deps =
libcst
commands=
/bin/bash -c './tools/strip_type_annotations.sh --check'
[testenv:proto]
basepython=python3
skip_install = true
deps =
grpcio==1.27.2
grpcio-tools==1.27.2
mypy-protobuf
changedir={toxinidir}/wandb/proto
commands=
python wandb_internal_codegen.py
[testenv:flake8]
basepython=python3
skip_install = true
deps =
flake8
flake8-colors
flake8-bugbear
pep8-naming
flake8-fixme
flake8-typing-imports>=1.1
flake8-import-order>=0.9
flake8-docstrings>=1.3.1
commands =
flake8
[testenv:pylint]
basepython=python3
deps=pylint
commands=
pylint -rn --rcfile={toxinidir}/.pylintrc wandb.sdk
[testenv:mypy]
basepython=python3
skip_install = true
deps=
mypy
lxml
setenv =
MYPYPATH = {toxinidir}
commands=
mypy --show-error-codes --config-file {toxinidir}/mypy.ini -p wandb --html-report mypy-results/
[testenv:coverage]
basepython=python3
deps=
coverage
pytest
commands=
coverage run --source wandb -m pytest
coverage report -m
[testenv:yapf]
basepython=python3
skip_install = true
deps=
yapf
commands=
/bin/bash -c 'yapf -d {toxinidir}/wandb/sdk/*.py'
[testenv:format]
basepython=python3
skip_install = true
deps=
black==19.10b0
commands=
black wandb/ tests/
[testenv:black]
basepython=python3
skip_install = true
deps=
black==19.10b0
commands=
black --check wandb/ tests/
[flake8]
max-line-length = 88
# ignore = D203, W503, E203
ignore =
# TODO()'s are allowed for now
T101,
W503,
# allow long lines, lets use blacks rules
E501,
# ignore space after comma rule, let black rule
E231,
# ignore whitespace before ':' (incompatible with black)
E203,
# select = C,E,F,W,B,B901,I,N
per-file-ignores =
tools/*:D
wandb/*:D
wandb/cli/cli.py:E501,C901,I202,E203,D # conflict with black
wandb/sdk/wandb_watch.py:E501,D
wandb/lib/git.py:E501,D
wandb/wandb_controller.py:N803,N806,D
wandb/apis/public.py:B006,D
wandb/sdk/wandb_run.py:D1,D2,D3,D4
wandb/sdk/wandb_init.py:D1,D2,D3,D4
exclude =
.tox,
.git,
__pycache__,
docs/source/conf.py,
docs/*.py,
build,
dist,
tests/fixtures/*,
tests/,
codemod/,
standalone_tests/,
wandb/__init__.py,
wandb/wandb_torch.py,
wandb/bin,
wandb/data/,
wandb/errors/,
wandb/old/,
wandb/sdk_py27/,
wandb/proto/,
wandb/util.py,
wandb/env.py,
wandb/sweeps/,
wandb/integration/magic.py,
wandb/integration/keras/,
wandb/integration/tensorboard/,
wandb/integration/lightgbm/,
wandb/integration/xgboost/,
wandb/integration/fastai/,
wandb/filesync/,
wandb/sdk/internal/internal_api.py,
wandb/sdk/internal/file_pusher.py,
wandb/sdk/internal/file_stream.py,
wandb/sdk/wandb_artifacts.py,
wandb/keras/,
wandb/compat/,
wandb/superagent/,
wandb/plots/,
wandb/sklearn/,
wandb/viz.py,
vendor/,
wandb/vendor/,
wandb/apis/__init__.py,
*.pyc,
*.egg-info,
.cache,
.eggs
max-complexity = 18
import-order-style = google
application-import-names = flake8
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
docstring-convention = google
[testenv:covercircle]
skip_install = true
basepython = python3
passenv = CI CIRCLECI CIRCLE_* CODECOV_* TOXENV
deps =
pytest
coverage
codecov
setenv =
CIRCLE_BUILD_NUM={env:CIRCLE_WORKFLOW_ID}
commands =
/usr/bin/env bash -c '{envpython} -m coverage combine {toxworkdir}/py*/.coverage'
coverage report --ignore-errors --skip-covered --omit "wandb/vendor/*"
codecov -e TOXENV
[testenv:cover]
skip_install = true
# basepython = python3.6
deps =
pytest
coverage
commands =
/usr/bin/env bash -c '{envpython} -m coverage combine {toxworkdir}/py*/.coverage'
coverage report --fail-under 80 --skip-covered --include "tests/*"
coverage report --fail-under 50 --skip-covered
[coverage:run]
omit =
*/wandb/vendor/*
[coverage:paths]
source =
wandb/sdk/
wandb/sdk_py27/