]>
Commit | Line | Data |
---|---|---|
9f95a23c | 1 | [tox] |
f6b5b4d7 TL |
2 | envlist = |
3 | py3, | |
20effc67 TL |
4 | py37, |
5 | lint, | |
f6b5b4d7 | 6 | mypy, |
f6b5b4d7 | 7 | fix |
f67539c2 | 8 | flake8 |
522d829b | 9 | jinjalint |
20effc67 | 10 | nooptional |
9f95a23c | 11 | skipsdist = true |
1911f103 | 12 | requires = cython |
20effc67 | 13 | skip_missing_interpreters = true |
9f95a23c | 14 | |
a4b75251 TL |
15 | [pytest] |
16 | log_level=NOTSET | |
20effc67 TL |
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} | |
a4b75251 | 27 | |
f6b5b4d7 TL |
28 | [flake8] |
29 | max-line-length = 100 | |
f67539c2 TL |
30 | ignore = |
31 | E501, | |
32 | W503, | |
f6b5b4d7 TL |
33 | exclude = |
34 | .tox, | |
35 | .vagrant, | |
36 | __pycache__, | |
37 | *.pyc, | |
38 | templates, | |
39 | .eggs | |
f67539c2 | 40 | statistics = True |
f6b5b4d7 TL |
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 | ||
9f95a23c | 50 | [testenv] |
1911f103 TL |
51 | setenv = |
52 | UNITTEST = true | |
f67539c2 | 53 | PYTHONPATH = $PYTHONPATH:.. |
1911f103 TL |
54 | deps = |
55 | cython | |
56 | -rrequirements.txt | |
20effc67 | 57 | -rrook/requirements.txt |
1911f103 | 58 | commands = |
20effc67 TL |
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 | ||
9f95a23c TL |
71 | |
72 | [testenv:mypy] | |
f67539c2 TL |
73 | setenv = |
74 | MYPYPATH = {toxinidir}/.. | |
75 | passenv = | |
76 | MYPYPATH | |
9f95a23c | 77 | basepython = python3 |
20effc67 TL |
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 | |
9f95a23c | 110 | deps = |
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 | 120 | commands = |
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] | |
126 | setenv = {[testenv]setenv} | |
127 | deps = {[testenv]deps} | |
128 | commands = {[testenv]commands} | |
129 | ||
130 | [testenv:fix] | |
131 | basepython = python3 | |
132 | deps = | |
133 | autopep8 | |
20effc67 TL |
134 | modules = |
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 |
149 | commands = |
150 | python --version | |
20effc67 TL |
151 | autopep8 {[autopep8]addopts} \ |
152 | {posargs:{[testenv:fix]modules}} | |
153 | ||
154 | [testenv:pylint] | |
155 | basepython = python3 | |
156 | deps = | |
157 | pylint | |
158 | modules = | |
159 | cli_api | |
160 | commands = | |
161 | pylint {[pylint]addopts} {posargs:{[testenv:pylint]modules}} | |
f67539c2 TL |
162 | |
163 | [testenv:flake8] | |
164 | basepython = python3 | |
165 | deps = | |
166 | flake8 | |
20effc67 | 167 | allowlist_externals = bash |
f67539c2 | 168 | modules = |
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 |
183 | commands = |
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] | |
189 | basepython = python3 | |
190 | deps = | |
191 | jinjaninja | |
192 | commands = | |
193 | jinja-ninja cephadm/templates |