]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/tox.ini
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / tox.ini
1 [tox]
2 envlist =
3 py3,
4 lint,
5 fix,
6 check,
7 run,
8 skipsdist = true
9 minversion = 2.9.1
10
11 [pytest]
12 addopts =
13 --cov --cov-append --cov-report=term
14 --doctest-modules
15 --ignore=frontend/ --ignore=module.py
16 --instafail
17
18 [base]
19 deps =
20 -rrequirements.txt
21 -cconstraints.txt
22
23 [base-test]
24 deps =
25 -rrequirements-test.txt
26
27 [base-lint]
28 deps =
29 -rrequirements-lint.txt
30
31 [testenv]
32 deps =
33 {[base]deps}
34 {[base-test]deps}
35 setenv =
36 CFLAGS = -DXMLSEC_NO_SIZE_T
37 PYTHONUNBUFFERED=1
38 PYTHONDONTWRITEBYTECODE=1
39 UNITTEST = true
40 WEBTEST_INTERACTIVE = false
41 commands =
42 pytest {posargs}
43
44 [testenv:run]
45 basepython=python3
46 deps =
47 {[base]deps}
48 {[base-test]deps}
49 {[base-lint]deps}
50 whitelist_externals = *
51 commands = {posargs}
52
53 [flake8]
54 max-line-length = 100
55 ignore = E123 E126 E226 E402 W503 E741 F812
56 exclude =
57 .tox,
58 .git,
59 __pycache__,
60 build,
61 dist,
62 *.egg-info,
63 .cache,
64 *.pyc,
65 .eggs,
66 venv,
67 frontend,
68 statistics = True
69 #TODO: Uncomment and refactor (https://tracker.ceph.com/issues/41221)
70 #max-complexity = 10
71 format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
72
73 [pylint]
74 # Allow similarity/code duplication detection
75 jobs = 1
76 dirs = . controllers plugins services tests
77 addopts = -rn --rcfile=.pylintrc --jobs={[pylint]jobs}
78
79 [rstlint]
80 dirs = README.rst HACKING.rst
81
82 [base-pylint]
83 commands =
84 pylint {[pylint]addopts} {[pylint]dirs}
85
86 [base-rst]
87 commands =
88 rstcheck --report info --debug -- {[rstlint]dirs}
89
90 [testenv:lint]
91 basepython=python3
92 deps =
93 {[base]deps}
94 {[base-lint]deps}
95 commands =
96 flake8
97 {[base-pylint]commands}
98 {[base-rst]commands}
99
100 [testenv:flake8]
101 basepython = python3
102 deps = {[base-lint]deps}
103 commands =
104 flake8 --config=tox.ini {posargs}
105
106 [testenv:pylint]
107 basepython = python3
108 deps =
109 {[base]deps}
110 {[base-lint]deps}
111 commands =
112 pylint {[pylint]addopts} {posargs:{[pylint]dirs}}
113
114 [testenv:rst]
115 basepython = python3
116 deps = {[base-lint]deps}
117 commands =
118 rstcheck --report info --debug -- {posargs:{[rstlint]dirs}}
119
120 [autopep8]
121 addopts =
122 --max-line-length {[flake8]max-line-length}
123 --exclude "{[flake8]exclude}"
124 --in-place
125 --recursive
126 # TODO: we should progressively increase the level of compliance with PEP8
127 # --aggressive
128 # --aggressive
129
130 [testenv:fix]
131 basepython=python3
132 deps =
133 {[base-lint]deps}
134 commands =
135 python --version
136 autopep8 {[autopep8]addopts} {posargs:.}
137
138
139 [testenv:check]
140 deps =
141 six==1.14.0
142 commands =
143 python ci/check_grafana_uids.py frontend/src/app ../../../../monitoring/grafana/dashboards