]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/tox.ini
6270dbdca51e3b1cbcee059a5d68295d0b5e5141
[ceph.git] / ceph / src / pybind / mgr / tox.ini
1 [tox]
2 envlist =
3 py3,
4 mypy,
5 fix
6 flake8
7 jinjalint
8 nooptional
9 skipsdist = true
10 skip_missing_interpreters = true
11
12 [pytest]
13 log_level=NOTSET
14 norecursedirs = dashboard rook/rook_client rook/rook-client-python
15
16 [base]
17 deps =
18 -rrequirements.txt
19
20 [pylint]
21 # Allow similarity/code duplication detection
22 jobs = 1
23 addopts = -rn --rcfile=.pylintrc --jobs={[pylint]jobs}
24
25 [flake8]
26 max-line-length = 100
27 ignore =
28 E501,
29 W503,
30 exclude =
31 .tox \
32 .vagrant \
33 __pycache__ \
34 *.pyc \
35 templates \
36 .eggs
37 statistics = True
38
39 [autopep8]
40 addopts =
41 --max-line-length {[flake8]max-line-length} \
42 --exclude "{[flake8]exclude}" \
43 --in-place \
44 --recursive \
45 --ignore-local-config
46
47 [testenv]
48 setenv =
49 UNITTEST = true
50 PYTHONPATH = $PYTHONPATH:..
51 deps =
52 behave
53 -rrequirements.txt
54 -rrook/requirements.txt
55 commands =
56 pytest --doctest-modules {posargs:}
57
58 [testenv:nooptional]
59 setenv =
60 UNITTEST = true
61 PYTHONPATH = $PYTHONPATH:..
62 deps =
63 -rrequirements.txt
64 commands =
65 pytest {posargs:cephadm/tests/test_ssh.py}
66
67
68 [testenv:mypy]
69 setenv =
70 MYPYPATH = {toxinidir}/..
71 passenv =
72 MYPYPATH
73 basepython = python3
74 deps =
75 -rrequirements.txt
76 -c{toxinidir}/../../mypy-constrains.txt
77 mypy
78 types-backports
79 types-pkg_resources
80 types-python-dateutil
81 types-requests
82 types-PyYAML
83 types-jwt
84 commands =
85 mypy --config-file=../../mypy.ini \
86 -m alerts \
87 -m balancer \
88 -m cephadm \
89 -m crash \
90 -m dashboard \
91 -m devicehealth \
92 -m diskprediction_local \
93 -m hello \
94 -m influx \
95 -m iostat \
96 -m localpool \
97 -m mds_autoscaler \
98 -m mgr_module \
99 -m mgr_util \
100 -m mirroring \
101 -m nfs \
102 -m orchestrator \
103 -m pg_autoscaler \
104 -m progress \
105 -m prometheus \
106 -m rbd_support \
107 -m rgw \
108 -m rook \
109 -m snap_schedule \
110 -m selftest \
111 -m stats \
112 -m status \
113 -m telegraf \
114 -m telemetry \
115 -m test_orchestrator \
116 -m volumes \
117 -m zabbix
118
119 [testenv:test]
120 setenv = {[testenv]setenv}
121 deps = {[testenv]deps}
122 commands = {[testenv]commands}
123
124 [testenv:fix]
125 basepython = python3
126 deps =
127 autopep8
128 modules =
129 alerts \
130 balancer \
131 cephadm \
132 cli_api \
133 crash \
134 devicehealth \
135 diskprediction_local \
136 insights \
137 iostat \
138 nfs \
139 orchestrator \
140 prometheus \
141 rgw \
142 status \
143 telemetry
144 commands =
145 python --version
146 autopep8 {[autopep8]addopts} \
147 {posargs:{[testenv:fix]modules}}
148
149 [testenv:pylint]
150 basepython = python3
151 deps =
152 pylint
153 modules =
154 cli_api
155 commands =
156 pylint {[pylint]addopts} {posargs:{[testenv:pylint]modules}}
157
158 [testenv:flake8]
159 basepython = python3
160 deps =
161 flake8
162 allowlist_externals = bash
163 modules =
164 alerts \
165 balancer \
166 cephadm \
167 cli_api \
168 crash \
169 devicehealth \
170 diskprediction_local \
171 hello \
172 iostat \
173 localpool \
174 nfs \
175 orchestrator \
176 prometheus \
177 rbd_support \
178 rgw \
179 selftest
180 commands =
181 flake8 --config=tox.ini {posargs} \
182 {posargs:{[testenv:flake8]modules}}
183 bash -c 'test $(git ls-files cephadm | grep ".py$" | grep -v tests | xargs grep "docker.io" | wc -l) == 13'
184
185 [testenv:jinjalint]
186 basepython = python3
187 deps =
188 jinjaninja
189 commands =
190 jinja-ninja cephadm/templates