blob: 4ab9aff2bd8008b8b13bafdb0217e1b71bf2c187 [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
Peter Pentchevac746792024-01-18 13:15:15 +020074 quick
Peter Pentchevb91fc932023-01-19 15:27:13 +020075deps =
Peter Pentchevb36195a2024-01-18 13:02:06 +020076 -r python/requirements/ruff.txt
Peter Pentchevb91fc932023-01-19 15:27:13 +020077commands =
78 ruff check --config python/config/ruff-all/pyproject.toml -- {[defs]pyfiles}
79
80[testenv:unit-tests]
81tags =
82 tests
83deps =
84 -r python/requirements/test.txt
85commands =
86 pytest {posargs} python/unit_tests
87
Peter Pentchevac746792024-01-18 13:15:15 +020088[testenv:reuse]
89skip_install = True
90tags =
91 check
92 quick
93deps =
94 reuse >= 2, < 3
95commands =
96 reuse --root={toxinidir} lint
97
Peter Pentchevb91fc932023-01-19 15:27:13 +020098[testenv:functional-cinder]
99tags =
100 tests
101setenv =
102 REPO_URL_OPENSTACK = {env:REPO_URL_OPENSTACK:https://github.com/openstack}
103commands =
104 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed
105 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed -s series.experimental