forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
226 lines (205 loc) · 8.53 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
[tox]
isolated_build = true
skip_missing_interpreters = true
envlist =
pre-commit
pre-merge
[testenv]
basepython = python3
passenv =
ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
SNYK_ENDPOINT
SNYK_TOKEN
deps =
torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchtext @ https://download.pytorch.org/whl/torchtext-0.14.1-cp38-cp38-linux_x86_64.whl
mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp38-cp38-manylinux1_x86_64.whl
-r{toxinidir}/requirements/api.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/anomaly.txt
-r{toxinidir}/requirements/classification.txt
-r{toxinidir}/requirements/detection.txt
-r{toxinidir}/requirements/segmentation.txt
-r{toxinidir}/requirements/action.txt
[testenv:pre-commit]
deps =
{[testenv]deps}
-r{toxinidir}/requirements/dev.txt
skip_install = true
commands =
pre-commit run --all-files
[testenv:pre-merge]
deps =
{[testenv]deps}
-r{toxinidir}/requirements/dev.txt
use_develop = true
commands =
coverage erase
coverage run -m pytest -ra --showlocals --junitxml={toxworkdir}/test-results.xml {posargs:tests/unit tests/integration}
coverage report -m --fail-under=0
coverage xml -o {toxworkdir}/coverage.xml
[testenv:pre-merge-cls]
deps =
torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchtext @ https://download.pytorch.org/whl/torchtext-0.14.1-cp38-cp38-linux_x86_64.whl
mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp38-cp38-manylinux1_x86_64.whl
-r{toxinidir}/requirements/api.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/classification.txt
-r{toxinidir}/requirements/dev.txt
use_develop = true
commands =
coverage erase
coverage run -m pytest -ra --showlocals --junitxml={toxworkdir}/test-results.xml tests/integration/cli/classification
coverage report -m --fail-under=0
coverage xml -o {toxworkdir}/coverage.xml
[testenv:pre-merge-det]
deps =
torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchtext @ https://download.pytorch.org/whl/torchtext-0.14.1-cp38-cp38-linux_x86_64.whl
mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp38-cp38-manylinux1_x86_64.whl
-r{toxinidir}/requirements/api.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/detection.txt
-r{toxinidir}/requirements/dev.txt
use_develop = true
commands =
coverage erase
coverage run -m pytest -ra --showlocals --junitxml={toxworkdir}/test-results.xml tests/integration/cli/detection
coverage report -m --fail-under=0
coverage xml -o {toxworkdir}/coverage.xml
[testenv:pre-merge-seg]
deps =
torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchtext @ https://download.pytorch.org/whl/torchtext-0.14.1-cp38-cp38-linux_x86_64.whl
mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp38-cp38-manylinux1_x86_64.whl
-r{toxinidir}/requirements/api.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/segmentation.txt
-r{toxinidir}/requirements/dev.txt
use_develop = true
commands =
coverage erase
coverage run -m pytest -ra --showlocals --junitxml={toxworkdir}/test-results.xml tests/integration/cli/segmentation
coverage report -m --fail-under=0
coverage xml -o {toxworkdir}/coverage.xml
[testenv:pre-merge-action]
deps =
torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchtext @ https://download.pytorch.org/whl/torchtext-0.14.1-cp38-cp38-linux_x86_64.whl
mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp38-cp38-manylinux1_x86_64.whl
-r{toxinidir}/requirements/api.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/action.txt
-r{toxinidir}/requirements/dev.txt
use_develop = true
commands =
coverage erase
coverage run -m pytest -ra --showlocals --junitxml={toxworkdir}/test-results.xml tests/integration/cli/action
coverage report -m --fail-under=0
coverage xml -o {toxworkdir}/coverage.xml
[testenv:pre-merge-anomaly]
deps =
torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchtext @ https://download.pytorch.org/whl/torchtext-0.14.1-cp38-cp38-linux_x86_64.whl
mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp38-cp38-manylinux1_x86_64.whl
-r{toxinidir}/requirements/api.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
-r{toxinidir}/requirements/anomaly.txt
-r{toxinidir}/requirements/dev.txt
use_develop = true
commands =
coverage erase
coverage run -m pytest -ra --showlocals --junitxml={toxworkdir}/test-results.xml tests/integration/cli/anomaly
coverage report -m --fail-under=0
coverage xml -o {toxworkdir}/coverage.xml
[testenv:fuzzing-test]
deps =
{[testenv:pre-merge]deps}
atheris
use_develop = true
commands =
coverage erase
- coverage run tests/fuzzing/cli_fuzzing.py {posargs:-dict=tests/fuzzing/assets/cli/operations.dict -artifact_prefix={toxworkdir}/ -print_final_stats=1 -atheris_runs=100000}
coverage report --precision=2
; coverage html -d {toxworkdir}/htmlcov
[testenv:build-doc]
deps =
{[testenv]deps}
-r{toxinidir}/requirements/docs.txt
use_develop = true
change_dir = {toxinidir}/docs
allowlist_externals =
make
commands =
make html
[testenv:build-pkg]
deps =
build==0.10.0
-r{toxinidir}/requirements/dev.txt
torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
skip_install = true
allowlist_externals =
rm
commands =
rm -rf ./dist
python -m build --sdist
python -m pip install dist/otx-1.0.0.tar.gz[full]
# python -m pip install otx[full]==1.0.0
pytest {posargs:tests/unit tests/integration/cli}
[testenv:snyk-scan]
allowlist_externals =
bash
curl
wget
chmod
rm
*snyk*
use_develop = true
commands =
bash -c "pip freeze > snyk-req.txt"
curl https://static.snyk.io/cli/latest/snyk-linux -o {toxworkdir}/snyk
chmod +x {toxworkdir}/snyk
{toxworkdir}/snyk config set endpoint={env:SNYK_ENDPOINT}
{toxworkdir}/snyk config set disable-analytics=1
- {toxworkdir}/snyk test --file=snyk-req.txt --package-manager=pip --sarif-file-output={toxworkdir}/snyk.sarif --json-file-output={toxworkdir}/snyk.json
- {toxworkdir}/snyk monitor --file=snyk-req.txt --package-manager=pip
wget -P .tox/ https://github.com/snyk/snyk-to-html/releases/download/v2.3.6/snyk-to-html-linux
chmod +x {toxworkdir}/snyk-to-html-linux
{toxworkdir}/snyk-to-html-linux -i {toxworkdir}/snyk.json -o {toxworkdir}/snyk.html -d
rm {toxworkdir}/snyk
rm {toxworkdir}/snyk-to-html-linux
rm snyk-req.txt
[testenv:weekly-test]
deps =
{[testenv]deps}
-r{toxinidir}/requirements/dev.txt
use_develop = true
commands =
coverage erase
coverage run -m pytest -ra --showlocals --junitxml={toxworkdir}/weekly-test-results.xml {posargs:tests/regression}
python tests/regression/summarize_test_results.py --output_path {toxworkdir}
[testenv:bandit-scan]
skip_install = true
deps =
bandit
allowlist_externals =
bandit
commands =
- bandit -r -c {toxinidir}/ipas_default.config {toxinidir}/ -f txt -o {toxworkdir}/bandit-report.txt