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