blob: fc858e462c6b7a3770b580d9435074f222312593 [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
Peter Pentchevb91fc932023-01-19 15:27:13 +020010 mypy
11 pylint
12 unit-tests
13 functional-cinder
14isolated_build = true
15
16[defs]
17pyfiles =
Peter Pentchev38e84722024-01-18 11:12:08 +020018 python/gifn_apply \
Peter Pentchevb91fc932023-01-19 15:27:13 +020019 python/unit_tests
20
21[testenv:black]
22skip_install = True
23tags =
24 check
25deps =
26 black >= 23, < 24
27commands =
28 black --check -- {[defs]pyfiles}
29
30[testenv:black-reformat]
31skip_install = True
32tags =
33 format
34 manual
35deps =
36 black >= 23, < 24
37commands =
38 black -- {[defs]pyfiles}
39
Peter Pentchevb91fc932023-01-19 15:27:13 +020040[testenv:mypy]
41skip_install = True
42tags =
43 check
44deps =
45 -r python/requirements/test.txt
46 mypy >= 1, < 2
47commands =
48 mypy -- {[defs]pyfiles}
49
50[testenv:pylint]
51skip_install = True
52tags =
53 check
54deps =
55 -r python/requirements/test.txt
56 pylint >= 2.16, < 2.17
57commands =
58 pylint -- {[defs]pyfiles}
59
60[testenv:ruff]
61skip_install = True
62tags =
63 check
Peter Pentchevac746792024-01-18 13:15:15 +020064 quick
Peter Pentchevb91fc932023-01-19 15:27:13 +020065deps =
Peter Pentchevb36195a2024-01-18 13:02:06 +020066 -r python/requirements/ruff.txt
Peter Pentchevb91fc932023-01-19 15:27:13 +020067commands =
68 ruff check --config python/config/ruff-all/pyproject.toml -- {[defs]pyfiles}
69
70[testenv:unit-tests]
71tags =
72 tests
73deps =
74 -r python/requirements/test.txt
75commands =
76 pytest {posargs} python/unit_tests
77
Peter Pentchevac746792024-01-18 13:15:15 +020078[testenv:reuse]
79skip_install = True
80tags =
81 check
82 quick
83deps =
84 reuse >= 2, < 3
85commands =
86 reuse --root={toxinidir} lint
87
Peter Pentchevb91fc932023-01-19 15:27:13 +020088[testenv:functional-cinder]
89tags =
90 tests
91setenv =
92 REPO_URL_OPENSTACK = {env:REPO_URL_OPENSTACK:https://github.com/openstack}
93commands =
94 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed
95 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed -s series.experimental