Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: StorPool <support@storpool.com> |
| 2 | # SPDX-License-Identifier: BSD-2-Clause |
| 3 | |
| 4 | [tox] |
Peter Pentchev | 38e8472 | 2024-01-18 11:12:08 +0200 | [diff] [blame] | 5 | minversion = 4.1 |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 6 | envlist = |
| 7 | ruff |
| 8 | ruff-all |
Peter Pentchev | c024c92 | 2024-01-18 13:31:11 +0200 | [diff] [blame] | 9 | format |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 10 | mypy |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 11 | unit-tests |
| 12 | functional-cinder |
| 13 | isolated_build = true |
| 14 | |
| 15 | [defs] |
| 16 | pyfiles = |
Peter Pentchev | 38e8472 | 2024-01-18 11:12:08 +0200 | [diff] [blame] | 17 | python/gifn_apply \ |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 18 | python/unit_tests |
| 19 | |
Peter Pentchev | c024c92 | 2024-01-18 13:31:11 +0200 | [diff] [blame] | 20 | [testenv:format] |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 21 | skip_install = True |
| 22 | tags = |
| 23 | check |
| 24 | deps = |
Peter Pentchev | c024c92 | 2024-01-18 13:31:11 +0200 | [diff] [blame] | 25 | -r python/requirements/ruff.txt |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 26 | commands = |
Peter Pentchev | 2c01f8f | 2024-01-18 13:37:48 +0200 | [diff] [blame^] | 27 | ruff check --config python/config/ruff-base/pyproject.toml --select=D,I --diff -- {[defs]pyfiles} |
Peter Pentchev | c024c92 | 2024-01-18 13:31:11 +0200 | [diff] [blame] | 28 | ruff format --check --config python/config/ruff-base/pyproject.toml --diff -- {[defs]pyfiles} |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 29 | |
Peter Pentchev | c024c92 | 2024-01-18 13:31:11 +0200 | [diff] [blame] | 30 | [testenv:reformat] |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 31 | skip_install = True |
| 32 | tags = |
| 33 | format |
| 34 | manual |
| 35 | deps = |
Peter Pentchev | c024c92 | 2024-01-18 13:31:11 +0200 | [diff] [blame] | 36 | -r python/requirements/ruff.txt |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 37 | commands = |
Peter Pentchev | 2c01f8f | 2024-01-18 13:37:48 +0200 | [diff] [blame^] | 38 | ruff check --config python/config/ruff-base/pyproject.toml --select=D,I --fix -- {[defs]pyfiles} |
Peter Pentchev | c024c92 | 2024-01-18 13:31:11 +0200 | [diff] [blame] | 39 | ruff format --config python/config/ruff-base/pyproject.toml -- {[defs]pyfiles} |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 40 | |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 41 | [testenv:mypy] |
| 42 | skip_install = True |
| 43 | tags = |
| 44 | check |
| 45 | deps = |
| 46 | -r python/requirements/test.txt |
| 47 | mypy >= 1, < 2 |
| 48 | commands = |
| 49 | mypy -- {[defs]pyfiles} |
| 50 | |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 51 | [testenv:ruff] |
| 52 | skip_install = True |
| 53 | tags = |
| 54 | check |
Peter Pentchev | ac74679 | 2024-01-18 13:15:15 +0200 | [diff] [blame] | 55 | quick |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 56 | deps = |
Peter Pentchev | b36195a | 2024-01-18 13:02:06 +0200 | [diff] [blame] | 57 | -r python/requirements/ruff.txt |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 58 | commands = |
| 59 | ruff check --config python/config/ruff-all/pyproject.toml -- {[defs]pyfiles} |
| 60 | |
| 61 | [testenv:unit-tests] |
| 62 | tags = |
| 63 | tests |
| 64 | deps = |
| 65 | -r python/requirements/test.txt |
| 66 | commands = |
| 67 | pytest {posargs} python/unit_tests |
| 68 | |
Peter Pentchev | ac74679 | 2024-01-18 13:15:15 +0200 | [diff] [blame] | 69 | [testenv:reuse] |
| 70 | skip_install = True |
| 71 | tags = |
| 72 | check |
| 73 | quick |
| 74 | deps = |
| 75 | reuse >= 2, < 3 |
| 76 | commands = |
| 77 | reuse --root={toxinidir} lint |
| 78 | |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 79 | [testenv:functional-cinder] |
| 80 | tags = |
| 81 | tests |
| 82 | setenv = |
| 83 | REPO_URL_OPENSTACK = {env:REPO_URL_OPENSTACK:https://github.com/openstack} |
| 84 | commands = |
| 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 |