]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/tox.ini
b781d1be67feceb0f3d185a740a9e7c2afa2997c
[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 -rrequirements.txt
53 -rrook/requirements.txt
54 commands =
55 pytest --doctest-modules {posargs:}
56
57 [testenv:nooptional]
58 setenv =
59 UNITTEST = true
60 PYTHONPATH = $PYTHONPATH:..
61 deps =
62 -rrequirements-required.txt
63 commands =
64 pytest {posargs:cephadm/tests/test_ssh.py}
65
66
67 [testenv:mypy]
68 setenv =
69 MYPYPATH = {toxinidir}/..
70 passenv =
71 MYPYPATH
72 basepython = python3
73 deps =
74 -rrequirements.txt
75 -c{toxinidir}/../../mypy-constrains.txt
76 mypy
77 types-backports
78 types-pkg_resources
79 types-python-dateutil
80 types-requests
81 types-PyYAML
82 types-jwt
83 commands =
84 mypy --config-file=../../mypy.ini \
85 -m alerts \
86 -m balancer \
87 -m cephadm \
88 -m crash \
89 -m dashboard \
90 -m devicehealth \
91 -m diskprediction_local \
92 -m hello \
93 -m influx \
94 -m iostat \
95 -m localpool \
96 -m mds_autoscaler \
97 -m mgr_module \
98 -m mgr_util \
99 -m mirroring \
100 -m nfs \
101 -m orchestrator \
102 -m pg_autoscaler \
103 -m progress \
104 -m prometheus \
105 -m rbd_support \
106 -m rgw \
107 -m rook \
108 -m snap_schedule \
109 -m selftest \
110 -m stats \
111 -m status \
112 -m telegraf \
113 -m telemetry \
114 -m test_orchestrator \
115 -m volumes \
116 -m zabbix
117
118 [testenv:test]
119 setenv = {[testenv]setenv}
120 deps = {[testenv]deps}
121 commands = {[testenv]commands}
122
123 [testenv:fix]
124 basepython = python3
125 deps =
126 autopep8
127 modules =
128 alerts \
129 balancer \
130 cephadm \
131 cli_api \
132 crash \
133 devicehealth \
134 diskprediction_local \
135 insights \
136 iostat \
137 nfs \
138 orchestrator \
139 prometheus \
140 rgw \
141 status \
142 telemetry
143 commands =
144 python --version
145 autopep8 {[autopep8]addopts} \
146 {posargs:{[testenv:fix]modules}}
147
148 [testenv:pylint]
149 basepython = python3
150 deps =
151 pylint
152 modules =
153 cli_api
154 commands =
155 pylint {[pylint]addopts} {posargs:{[testenv:pylint]modules}}
156
157 [testenv:flake8]
158 basepython = python3
159 deps =
160 flake8
161 allowlist_externals = bash
162 modules =
163 alerts \
164 balancer \
165 cephadm \
166 cli_api \
167 crash \
168 devicehealth \
169 diskprediction_local \
170 hello \
171 iostat \
172 localpool \
173 nfs \
174 orchestrator \
175 prometheus \
176 rbd_support \
177 rgw \
178 selftest
179 commands =
180 flake8 --config=tox.ini {posargs} \
181 {posargs:{[testenv:flake8]modules}}
182 bash -c 'test $(git ls-files cephadm | grep ".py$" | grep -v tests | xargs grep "docker.io" | wc -l) == 13'
183
184 [testenv:jinjalint]
185 basepython = python3
186 deps =
187 jinjaninja
188 commands =
189 jinja-ninja cephadm/templates