-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtox.ini
120 lines (106 loc) · 3.18 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
[tox]
envlist = py310,pep8,bandit
setupdir=python/
minversion = 3.28.0
[testenv]
setenv = YAMLDIR = {toxinidir}/python/tests/yaml_samples/
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY
deps=
-r{toxinidir}/python/requirements-frozen.txt
-r{toxinidir}/python/test-requirements.txt
[testenv:venv]
commands = {posargs}
[testenv:freeze]
recreate = True
allowlist_externals=
rm
sh
deps=
-r{toxinidir}/python/requirements-direct.txt
-c https://raw.githubusercontent.com/apache/airflow/constraints-2.10.4/constraints-3.10.txt
commands=
rm -f python/requirements-frozen.txt
sh -c "pip freeze --all | grep -vE 'drydock_provisioner|pyinotify|pkg-resources==0.0.0' > python/requirements-frozen.txt"
[testenv:yapf]
allowlist_externals=find
commands=
yapf -i -r --style=pep8 {toxinidir}/python/setup.py
yapf -i -r --style=pep8 {toxinidir}/alembic
yapf -i -r --style=pep8 {toxinidir}/python/drydock_provisioner
yapf -i -r --style=pep8 {toxinidir}/python/tests
find {toxinidir}/python/drydock_provisioner -name '__init__.py' -exec yapf -i --style=pep8 \{\} ;
[testenv:py310]
usedevelop=True
allowlist_externals=
py.test
setenv=
PYTHONWARNING=all
YAMLDIR={toxinidir}/python/tests/yaml_samples/
commands=
py.test \
--cov=drydock_provisioner \
{toxinidir}/python/tests/unit/{posargs}
[testenv:integration]
passenv=DOCKER_REGISTRY,IMAGE_NAME,IMAGE_PREFIX,IMAGE_TAG,DISTRO
setenv=
PYTHONWARNING=all
YAMLDIR={toxinidir}/python/tests/yaml_samples/
allowlist_externals=
sh
pip3
py.test
commands=
pip3 install ./python/ --use-pep517
sh -c {toxinidir}/python/tests/postgres/start_postgres.sh
py.test \
{toxinidir}/python/tests/integration/postgres/{posargs}
[testenv:cover]
usedevelop=True
passenv=DOCKER_REGISTRY,IMAGE_NAME,IMAGE_PREFIX,IMAGE_TAG,DISTRO
setenv=
YAMLDIR={toxinidir}/python/tests/yaml_samples/
allowlist_externals=
sh
commands=
sh -c {toxinidir}/python/tests/postgres/start_postgres.sh
py.test \
--cov=drydock_provisioner \
--cov-report html:cover \
--cov-report xml:cover/coverage.xml \
--cov-report term \
--cov-fail-under 49 \
{toxinidir}/python/tests/unit/ \
{toxinidir}/python/tests/integration/postgres
[testenv:genconfig]
allowlist_externals =
tee
sh
commands =
pip3 install ./python/ --use-pep517
sh -c 'oslo-config-generator --config-file=etc/drydock/drydock-config-generator.conf | tee etc/drydock/drydock.conf.sample doc/source/_static/drydock.conf.sample'
[testenv:genpolicy]
allowlist_externals =
tee
sh
commands =
pip3 install ./python/ --use-pep517
sh -c 'oslopolicy-sample-generator --config-file etc/drydock/drydock-policy-generator.conf | tee etc/drydock/policy.yaml.sample doc/source/_static/policy.yaml.sample'
[testenv:pep8]
commands =
flake8 {posargs}
bandit -r drydock_provisioner -n 5
[testenv:bandit]
commands = bandit -r drydock_provisioner -n 5
[flake8]
ignore=E302,H306,H304,W503,E251,E126
exclude= venv,.venv,.git,.idea,.tox,*.egg-info,*.eggs,bin,dist,./build/,alembic/
max-line-length=119
[testenv:docs]
deps=
-rdoc/requirements-doc.txt
-epython
allowlist_externals=rm
recreate=true
commands =
rm -rf doc/build
sphinx-build -b html doc/source doc/build/html