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