blob: 335108916dc58e4d1d08e23e8bc69283eac93552 [file] [log] [blame]
Peter Pentchevb91fc932023-01-19 15:27:13 +02001# SPDX-FileCopyrightText: StorPool <support@storpool.com>
2# SPDX-License-Identifier: BSD-2-Clause
3
4[tox]
Peter Pentchev38e84722024-01-18 11:12:08 +02005minversion = 4.1
Peter Pentchevb91fc932023-01-19 15:27:13 +02006envlist =
7 ruff
8 ruff-all
9 black
10 pep8
11 mypy
12 pylint
13 unit-tests
14 functional-cinder
15isolated_build = true
16
17[defs]
18pyfiles =
Peter Pentchev38e84722024-01-18 11:12:08 +020019 python/gifn_apply \
Peter Pentchevb91fc932023-01-19 15:27:13 +020020 python/unit_tests
21
22[testenv:black]
23skip_install = True
24tags =
25 check
26deps =
27 black >= 23, < 24
28commands =
29 black --check -- {[defs]pyfiles}
30
31[testenv:black-reformat]
32skip_install = True
33tags =
34 format
35 manual
36deps =
37 black >= 23, < 24
38commands =
39 black -- {[defs]pyfiles}
40
41[testenv:pep8]
42skip_install = True
43tags =
44 check
45deps =
46 flake8 >= 6, < 7
47commands =
48 flake8 -- {[defs]pyfiles}
49
50[testenv:mypy]
51skip_install = True
52tags =
53 check
54deps =
55 -r python/requirements/test.txt
56 mypy >= 1, < 2
57commands =
58 mypy -- {[defs]pyfiles}
59
60[testenv:pylint]
61skip_install = True
62tags =
63 check
64deps =
65 -r python/requirements/test.txt
66 pylint >= 2.16, < 2.17
67commands =
68 pylint -- {[defs]pyfiles}
69
70[testenv:ruff]
71skip_install = True
72tags =
73 check
74deps =
Peter Pentchevb91fc932023-01-19 15:27:13 +020075 ruff == 0.0.253
76commands =
77 ruff check --config python/config/ruff-all/pyproject.toml -- {[defs]pyfiles}
78
79[testenv:unit-tests]
80tags =
81 tests
82deps =
83 -r python/requirements/test.txt
84commands =
85 pytest {posargs} python/unit_tests
86
87[testenv:functional-cinder]
88tags =
89 tests
90setenv =
91 REPO_URL_OPENSTACK = {env:REPO_URL_OPENSTACK:https://github.com/openstack}
92commands =
93 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed
94 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed -s series.experimental