forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
105 lines (93 loc) · 3.14 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
[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: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