summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/tox.ini
blob: 6270dbdca51e3b1cbcee059a5d68295d0b5e5141 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
[tox]
envlist =
    py3,
    mypy,
    fix
    flake8
    jinjalint
    nooptional
skipsdist = true
skip_missing_interpreters = true

[pytest]
log_level=NOTSET
norecursedirs = dashboard rook/rook_client rook/rook-client-python

[base]
deps =
    -rrequirements.txt

[pylint]
# Allow similarity/code duplication detection
jobs = 1
addopts = -rn --rcfile=.pylintrc --jobs={[pylint]jobs}

[flake8]
max-line-length = 100
ignore =
    E501,
    W503,
exclude =
    .tox \
    .vagrant \
    __pycache__ \
    *.pyc \
    templates \
    .eggs
statistics = True

[autopep8]
addopts =
    --max-line-length {[flake8]max-line-length} \
    --exclude "{[flake8]exclude}" \
    --in-place \
    --recursive \
    --ignore-local-config

[testenv]
setenv =
    UNITTEST = true
    PYTHONPATH = $PYTHONPATH:..
deps =
    behave
    -rrequirements.txt
    -rrook/requirements.txt
commands =
    pytest --doctest-modules {posargs:}

[testenv:nooptional]
setenv =
    UNITTEST = true
    PYTHONPATH = $PYTHONPATH:..
deps =
    -rrequirements.txt
commands =
    pytest {posargs:cephadm/tests/test_ssh.py}


[testenv:mypy]
setenv =
    MYPYPATH = {toxinidir}/..
passenv =
    MYPYPATH
basepython = python3
deps =
    -rrequirements.txt
    -c{toxinidir}/../../mypy-constrains.txt
    mypy
    types-backports
    types-pkg_resources
    types-python-dateutil
    types-requests
    types-PyYAML
    types-jwt
commands =
    mypy --config-file=../../mypy.ini \
           -m alerts \
           -m balancer \
           -m cephadm \
           -m crash \
           -m dashboard \
           -m devicehealth \
           -m diskprediction_local \
           -m hello \
           -m influx \
           -m iostat \
           -m localpool \
           -m mds_autoscaler \
           -m mgr_module \
           -m mgr_util \
           -m mirroring \
           -m nfs \
           -m orchestrator \
           -m pg_autoscaler \
           -m progress \
           -m prometheus \
           -m rbd_support \
	   -m rgw \
           -m rook \
           -m snap_schedule \
           -m selftest \
           -m stats \
           -m status \
           -m telegraf \
           -m telemetry \
           -m test_orchestrator \
           -m volumes \
           -m zabbix

[testenv:test]
setenv = {[testenv]setenv}
deps = {[testenv]deps}
commands = {[testenv]commands}

[testenv:fix]
basepython = python3
deps =
    autopep8
modules =
    alerts \
    balancer \
    cephadm \
    cli_api \
    crash \
    devicehealth \
    diskprediction_local \
    insights \
    iostat \
    nfs \
    orchestrator \
    prometheus \
    rgw \
    status \
    telemetry
commands =
    python --version
    autopep8 {[autopep8]addopts} \
      {posargs:{[testenv:fix]modules}}

[testenv:pylint]
basepython = python3
deps =
    pylint
modules =
    cli_api
commands =
    pylint {[pylint]addopts} {posargs:{[testenv:pylint]modules}}

[testenv:flake8]
basepython = python3
deps =
    flake8
allowlist_externals = bash
modules =
    alerts \
    balancer \
    cephadm \
    cli_api \
    crash \
    devicehealth \
    diskprediction_local \
    hello \
    iostat \
    localpool \
    nfs \
    orchestrator \
    prometheus \
    rbd_support \
    rgw \
    selftest
commands =
    flake8 --config=tox.ini {posargs} \
      {posargs:{[testenv:flake8]modules}}
    bash -c 'test $(git ls-files cephadm | grep ".py$" | grep -v tests | xargs grep "docker.io" | wc -l) == 13'

[testenv:jinjalint]
basepython = python3
deps =
    jinjaninja
commands =
    jinja-ninja cephadm/templates