forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
152 lines (134 loc) · 5.29 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
[tox]
isolated_build = true
skip_missing_interpreters = true
[pytest]
addopts = --csv=.tox/tests-{env:TOXENV_TASK}-{env:TOXENV_PYVER}.csv
[testenv]
setenv =
TOX_WORK_DIR={toxworkdir}
passenv =
ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
CI_DATA_ROOT
test_dir =
all: cli
ano: cli/anomaly
cls: cli/classification
det: cli/detection
iseg,iseg_t: cli/instance_segmentation
seg: cli/semantic_segmentation
act: cli/action
visprompt: cli/visual_prompting
deps =
py38-pt1: torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl
py38-pt1: torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl
{all,act,cls,det,seg,iseg,iseg_t}-py38-pt1: mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp38-cp38-manylinux1_x86_64.whl
py39-pt1: torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp39-cp39-linux_x86_64.whl
py39-pt1: torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp39-cp39-linux_x86_64.whl
{all,act,cls,det,seg,iseg,iseg_t}-py39-pt1: mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp39-cp39-manylinux1_x86_64.whl
py310-pt1: torch @ https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-linux_x86_64.whl
py310-pt1: torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp310-cp310-linux_x86_64.whl
{all,act,cls,det,seg,iseg,iseg_t}-py310-pt1: mmcv-full @ https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/mmcv_full-1.7.0-cp310-cp310-manylinux1_x86_64.whl
py38-pt2: torch @ https://download.pytorch.org/whl/cu117/torch-2.0.1%2Bcu117-cp38-cp38-linux_x86_64.whl
py38-pt2: torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.15.2%2Bcu117-cp38-cp38-linux_x86_64.whl
py39-pt2: torch @ https://download.pytorch.org/whl/cu117/torch-2.0.1%2Bcu117-cp39-cp39-linux_x86_64.whl
py39-pt2: torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.15.2%2Bcu117-cp39-cp39-linux_x86_64.whl
py310-pt2: torch @ https://download.pytorch.org/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl
py310-pt2: torchvision @ https://download.pytorch.org/whl/cu117/torchvision-0.15.2%2Bcu117-cp310-cp310-linux_x86_64.whl
extras =
all: full
ano: anomaly
act: action
det,iseg,iseg_t: detection
cls: classification
seg: segmentation
visprompt: visual_prompting
[testenv:pre-commit-all-{py38,py39,py310}-{pt1,pt2}]
deps =
{[testenv]deps}
-r{toxinidir}/requirements/dev.txt
skip_install = true
commands =
pre-commit run --all-files
[testenv:tests-{all,ano,cls,det,iseg,iseg_t,seg,act,visprompt}-{py38,py39,py310}-{pt1,pt2}]
deps =
{[testenv]deps}
-r{toxinidir}/requirements/dev.txt
commands =
python -m pytest -ra --showlocals --csv={toxworkdir}/{envname}.csv {posargs:tests/integration/{[testenv]test_dir}}
[testenv:unittest-all-{py38,py39,py310}-{pt1,pt2}]
deps =
{[testenv]deps}
-r{toxinidir}/requirements/dev.txt
use_develop = true
extras = full
commands =
coverage erase
coverage run -m pytest -ra --showlocals --csv={toxworkdir}/{envname}.csv {posargs:tests/unit}
coverage report -m --fail-under=0
coverage xml -o {toxworkdir}/coverage.xml
[testenv:fuzzing]
deps =
{[testenv:tests-all-py310-pt1]deps}
atheris
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=500000}
coverage report --precision=2
; coverage html -d {toxworkdir}/htmlcov
[testenv:build-doc]
deps =
{[testenv:tests-all-py310-pt1]deps}
-r{toxinidir}/requirements/docs.txt
change_dir = {toxinidir}/docs
allowlist_externals =
make
commands =
make html
[testenv:package-py{38,39,310}-{pt1,pt2}]
deps =
{[testenv]deps}
build==0.10.0
-r{toxinidir}/requirements/dev.txt
skip_install = true
allowlist_externals =
rm
find
commands =
rm -rf ./dist
python -m build --sdist
find ./dist -type f -name *.tar.gz -exec pip install {}[full] \;
pytest {posargs:tests/unit tests/integration/cli}
[testenv:trivy-scan]
deps =
{[testenv:tests-all-py310-pt1]deps}
passenv =
{[testenv]passenv}
TRIVY_DOWNLOAD_URL
allowlist_externals =
bash
curl
tar
rm
*trivy*
extras = full
commands =
bash -c "pip freeze > requirements.txt"
curl -L0 {env:TRIVY_DOWNLOAD_URL} -o {toxworkdir}/trivy.tar.gz
tar -xzf {toxworkdir}/trivy.tar.gz -C {toxworkdir}
{toxworkdir}/trivy fs -d -c .ci/trivy.yaml -o {toxworkdir}/trivy-results-otx.txt ./requirements.txt
{toxworkdir}/trivy fs -d -c .ci/trivy.yaml --list-all-pkgs --format template --template "@.ci/csv.tmpl" -o {toxworkdir}/trivy-results-otx.csv ./requirements.txt
{toxworkdir}/trivy fs -d -c .ci/trivy.yaml --format spdx-json -o {toxworkdir}/trivy-spdx-otx.json ./requirements.txt
rm {toxworkdir}/trivy.tar.gz
rm {toxworkdir}/trivy
rm requirements.txt
[testenv:bandit-scan]
skip_install = true
deps =
bandit
allowlist_externals =
bandit
commands =
- bandit -r -c .ci/ipas_default.config {toxinidir}/ -f txt -o {toxworkdir}/bandit-report.txt