blob: df7df5e2c5682c6986a59de8bd1555deadaa5833 [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 Pentchev2c01f8f2024-01-18 13:37:48 +020027 ruff check --config python/config/ruff-base/pyproject.toml --select=D,I --diff -- {[defs]pyfiles}
Peter Pentchevc024c922024-01-18 13:31:11 +020028 ruff format --check --config python/config/ruff-base/pyproject.toml --diff -- {[defs]pyfiles}
Peter Pentchevb91fc932023-01-19 15:27:13 +020029
Peter Pentchevc024c922024-01-18 13:31:11 +020030[testenv:reformat]
Peter Pentchevb91fc932023-01-19 15:27:13 +020031skip_install = True
32tags =
33 format
34 manual
35deps =
Peter Pentchevc024c922024-01-18 13:31:11 +020036 -r python/requirements/ruff.txt
Peter Pentchevb91fc932023-01-19 15:27:13 +020037commands =
Peter Pentchev2c01f8f2024-01-18 13:37:48 +020038 ruff check --config python/config/ruff-base/pyproject.toml --select=D,I --fix -- {[defs]pyfiles}
Peter Pentchevc024c922024-01-18 13:31:11 +020039 ruff format --config python/config/ruff-base/pyproject.toml -- {[defs]pyfiles}
Peter Pentchevb91fc932023-01-19 15:27:13 +020040
Peter Pentchevb91fc932023-01-19 15:27:13 +020041[testenv:mypy]
42skip_install = True
43tags =
44 check
45deps =
46 -r python/requirements/test.txt
47 mypy >= 1, < 2
48commands =
49 mypy -- {[defs]pyfiles}
50
Peter Pentchevb91fc932023-01-19 15:27:13 +020051[testenv:ruff]
52skip_install = True
53tags =
54 check
Peter Pentchevac746792024-01-18 13:15:15 +020055 quick
Peter Pentchevb91fc932023-01-19 15:27:13 +020056deps =
Peter Pentchevb36195a2024-01-18 13:02:06 +020057 -r python/requirements/ruff.txt
Peter Pentchevb91fc932023-01-19 15:27:13 +020058commands =
59 ruff check --config python/config/ruff-all/pyproject.toml -- {[defs]pyfiles}
60
61[testenv:unit-tests]
62tags =
63 tests
64deps =
65 -r python/requirements/test.txt
66commands =
67 pytest {posargs} python/unit_tests
68
Peter Pentchevac746792024-01-18 13:15:15 +020069[testenv:reuse]
70skip_install = True
71tags =
72 check
73 quick
74deps =
75 reuse >= 2, < 3
76commands =
77 reuse --root={toxinidir} lint
78
Peter Pentchevb91fc932023-01-19 15:27:13 +020079[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