blob: cbcb90ae39a8a18a2c5d02a6ec3bcda5ed11f4f4 [file] [log] [blame]
Peter Pentchev096b8432024-01-18 13:53:09 +02001# SPDX-FileCopyrightText: StorPool <support@storpool.com>
2# SPDX-License-Identifier: BSD-2-Clause
3
4[tox]
5minversion = 4.1
6envlist =
7 ruff
8 ruff-all
9 format
10 mypy
11 unit-tests
12 functional-cinder
13isolated_build = true
14
15[defs]
16pyfiles =
17 src/gifn_apply \
18 tests/unit
19
20[testenv:format]
21skip_install = True
22tags =
23 check
24deps =
25 -r requirements/ruff.txt
26commands =
Peter Pentchev01ad6a32024-02-20 10:16:00 +020027 ruff check --config config/ruff/base.toml --select=D,I --diff -- {[defs]pyfiles}
28 ruff format --check --config config/ruff/base.toml --diff -- {[defs]pyfiles}
Peter Pentchev096b8432024-01-18 13:53:09 +020029
30[testenv:reformat]
31skip_install = True
32tags =
33 format
34 manual
35deps =
36 -r requirements/ruff.txt
37commands =
Peter Pentchev01ad6a32024-02-20 10:16:00 +020038 ruff check --config config/ruff/base.toml --select=D,I --fix -- {[defs]pyfiles}
39 ruff format --config config/ruff/base.toml -- {[defs]pyfiles}
Peter Pentchev096b8432024-01-18 13:53:09 +020040
41[testenv:mypy]
42skip_install = True
43tags =
44 check
45deps =
46 -r requirements/test.txt
47 mypy >= 1, < 2
48commands =
49 mypy -- {[defs]pyfiles}
50
51[testenv:ruff]
52skip_install = True
53tags =
54 check
55 quick
56deps =
57 -r requirements/ruff.txt
58commands =
Peter Pentchev01ad6a32024-02-20 10:16:00 +020059 ruff check --config config/ruff/all.toml -- {[defs]pyfiles}
Peter Pentchev096b8432024-01-18 13:53:09 +020060
61[testenv:unit-tests]
62tags =
63 tests
64deps =
65 -r requirements/test.txt
66commands =
67 pytest {posargs} tests/unit
68
69[testenv:reuse]
70skip_install = True
71tags =
72 check
73 quick
74deps =
75 reuse >= 2, < 3
76commands =
77 reuse --root={toxinidir}/.. lint
78
79[testenv:functional-cinder]
80tags =
81 tests
82setenv =
83 REPO_URL_OPENSTACK = {env:REPO_URL_OPENSTACK:https://github.com/openstack}
84commands =
85 gifn_apply -v -p {toxinidir}/../../../patches -P {toxinidir}/../sh/git-if-needed
86 gifn_apply -v -p {toxinidir}/../../../patches -P {toxinidir}/../sh/git-if-needed -s series.experimental