blob: 6c8ad52fac807888991a2f59a6a7356955f20b56 [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
Peter Pentchevc024c922024-01-18 13:31:11 +02009 format
Peter Pentchevb91fc932023-01-19 15:27:13 +020010 mypy
Peter Pentchevb91fc932023-01-19 15:27:13 +020011 unit-tests
12 functional-cinder
13isolated_build = true
14
15[defs]
16pyfiles =
Peter Pentchev38e84722024-01-18 11:12:08 +020017 python/gifn_apply \
Peter Pentchevb91fc932023-01-19 15:27:13 +020018 python/unit_tests
19
Peter Pentchevc024c922024-01-18 13:31:11 +020020[testenv:format]
Peter Pentchevb91fc932023-01-19 15:27:13 +020021skip_install = True
22tags =
23 check
24deps =
Peter Pentchevc024c922024-01-18 13:31:11 +020025 -r python/requirements/ruff.txt
Peter Pentchevb91fc932023-01-19 15:27:13 +020026commands =
Peter Pentchevc024c922024-01-18 13:31:11 +020027 ruff format --check --config python/config/ruff-base/pyproject.toml --diff -- {[defs]pyfiles}
Peter Pentchevb91fc932023-01-19 15:27:13 +020028
Peter Pentchevc024c922024-01-18 13:31:11 +020029[testenv:reformat]
Peter Pentchevb91fc932023-01-19 15:27:13 +020030skip_install = True
31tags =
32 format
33 manual
34deps =
Peter Pentchevc024c922024-01-18 13:31:11 +020035 -r python/requirements/ruff.txt
Peter Pentchevb91fc932023-01-19 15:27:13 +020036commands =
Peter Pentchevc024c922024-01-18 13:31:11 +020037 ruff format --config python/config/ruff-base/pyproject.toml -- {[defs]pyfiles}
Peter Pentchevb91fc932023-01-19 15:27:13 +020038
Peter Pentchevb91fc932023-01-19 15:27:13 +020039[testenv:mypy]
40skip_install = True
41tags =
42 check
43deps =
44 -r python/requirements/test.txt
45 mypy >= 1, < 2
46commands =
47 mypy -- {[defs]pyfiles}
48
Peter Pentchevb91fc932023-01-19 15:27:13 +020049[testenv:ruff]
50skip_install = True
51tags =
52 check
Peter Pentchevac746792024-01-18 13:15:15 +020053 quick
Peter Pentchevb91fc932023-01-19 15:27:13 +020054deps =
Peter Pentchevb36195a2024-01-18 13:02:06 +020055 -r python/requirements/ruff.txt
Peter Pentchevb91fc932023-01-19 15:27:13 +020056commands =
57 ruff check --config python/config/ruff-all/pyproject.toml -- {[defs]pyfiles}
58
59[testenv:unit-tests]
60tags =
61 tests
62deps =
63 -r python/requirements/test.txt
64commands =
65 pytest {posargs} python/unit_tests
66
Peter Pentchevac746792024-01-18 13:15:15 +020067[testenv:reuse]
68skip_install = True
69tags =
70 check
71 quick
72deps =
73 reuse >= 2, < 3
74commands =
75 reuse --root={toxinidir} lint
76
Peter Pentchevb91fc932023-01-19 15:27:13 +020077[testenv:functional-cinder]
78tags =
79 tests
80setenv =
81 REPO_URL_OPENSTACK = {env:REPO_URL_OPENSTACK:https://github.com/openstack}
82commands =
83 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed
84 gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed -s series.experimental