-
Notifications
You must be signed in to change notification settings - Fork 13
/
tox.ini
122 lines (108 loc) · 2.96 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
[tox]
skipsdist = True
minversion = 3.18.0
envlist = py310, pep8, cover, bandit
[testenv]
deps=
-r{toxinidir}/requirements-frozen.txt
-r{toxinidir}/test-requirements.txt
passenv=
HTTP_PROXY
HTTPS_PROXY
http_proxy
https_proxy
NO_PROXY
no_proxy
setenv=
VIRTUAL_ENV={envdir}
usedevelop = True
install_command = pip install {opts} {packages}
allowlist_externals =
bash
find
rm
commands =
find . -type f -name "*.pyc" -delete
rm -Rf .testrepository/times.dbm
[testenv:venv]
commands =
{posargs}
[testenv:freeze]
basepython=python3
recreate = True
allowlist_externals=
rm
sh
deps=
-r{toxinidir}/requirements-direct.txt
-c https://raw.githubusercontent.com/apache/airflow/constraints-2.10.2/constraints-3.10.txt
commands=
rm -f requirements-frozen.txt
sh -c "pip freeze --all | grep -vE 'armada|pyinotify|pkg-resources==0.0.0' > requirements-frozen.txt"
[testenv:py310]
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:docs]
deps=
-r{toxinidir}/requirements-frozen.txt
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
[testenv:genconfig]
commands =
pip install . --use-pep517
oslo-config-generator --config-file=etc/armada/config-generator.conf
[testenv:genpolicy]
commands =
pip install . --use-pep517
oslopolicy-sample-generator --config-file=etc/armada/policy-generator.conf
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
deps =
.[bandit]
{[testenv]deps}
commands =
# Whitespace linter (for chart files)
bash {toxinidir}/tools/whitespace-linter.sh
yapf -dr {toxinidir}/armada {toxinidir}/setup.py
flake8 {toxinidir}/armada {toxinidir}/setup.py
# Run security linter as part of the pep8 gate instead of a separate zuul job.
bandit -r armada -n 5 -x armada/tests/*
[testenv:bandit]
commands =
bandit -r armada -n 5 -x armada/tests/*
[testenv:cover]
setenv = {[testenv]setenv}
PYTHON=coverage run --source armada --parallel-mode
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:fmt]
deps = {[testenv]deps}
commands =
yapf -ir {toxinidir}/armada {toxinidir}/setup.py
[flake8]
filename = *.py
show-source = true
# [H106] Don't put vim configuration in source files.
# [H201] No 'except:' at least use 'except Exception:'
# [H904] Delay string interpolations at logging calls.
enable-extensions = H106,H201,H904
# [W503] line break before binary operator
ignore = W503,B202,B113
exclude = .git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc/*,venv
max-complexity = 24
application-import-names = armada
import-order-style = pep8