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 |
| 9 | black |
| 10 | pep8 |
| 11 | mypy |
| 12 | pylint |
| 13 | unit-tests |
| 14 | functional-cinder |
| 15 | isolated_build = true |
| 16 | |
| 17 | [defs] |
| 18 | pyfiles = |
Peter Pentchev | 38e8472 | 2024-01-18 11:12:08 +0200 | [diff] [blame] | 19 | python/gifn_apply \ |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 20 | python/unit_tests |
| 21 | |
| 22 | [testenv:black] |
| 23 | skip_install = True |
| 24 | tags = |
| 25 | check |
| 26 | deps = |
| 27 | black >= 23, < 24 |
| 28 | commands = |
| 29 | black --check -- {[defs]pyfiles} |
| 30 | |
| 31 | [testenv:black-reformat] |
| 32 | skip_install = True |
| 33 | tags = |
| 34 | format |
| 35 | manual |
| 36 | deps = |
| 37 | black >= 23, < 24 |
| 38 | commands = |
| 39 | black -- {[defs]pyfiles} |
| 40 | |
| 41 | [testenv:pep8] |
| 42 | skip_install = True |
| 43 | tags = |
| 44 | check |
| 45 | deps = |
| 46 | flake8 >= 6, < 7 |
| 47 | commands = |
| 48 | flake8 -- {[defs]pyfiles} |
| 49 | |
| 50 | [testenv:mypy] |
| 51 | skip_install = True |
| 52 | tags = |
| 53 | check |
| 54 | deps = |
| 55 | -r python/requirements/test.txt |
| 56 | mypy >= 1, < 2 |
| 57 | commands = |
| 58 | mypy -- {[defs]pyfiles} |
| 59 | |
| 60 | [testenv:pylint] |
| 61 | skip_install = True |
| 62 | tags = |
| 63 | check |
| 64 | deps = |
| 65 | -r python/requirements/test.txt |
| 66 | pylint >= 2.16, < 2.17 |
| 67 | commands = |
| 68 | pylint -- {[defs]pyfiles} |
| 69 | |
| 70 | [testenv:ruff] |
| 71 | skip_install = True |
| 72 | tags = |
| 73 | check |
| 74 | deps = |
Peter Pentchev | b91fc93 | 2023-01-19 15:27:13 +0200 | [diff] [blame] | 75 | ruff == 0.0.253 |
| 76 | commands = |
| 77 | ruff check --config python/config/ruff-all/pyproject.toml -- {[defs]pyfiles} |
| 78 | |
| 79 | [testenv:unit-tests] |
| 80 | tags = |
| 81 | tests |
| 82 | deps = |
| 83 | -r python/requirements/test.txt |
| 84 | commands = |
| 85 | pytest {posargs} python/unit_tests |
| 86 | |
| 87 | [testenv:functional-cinder] |
| 88 | tags = |
| 89 | tests |
| 90 | setenv = |
| 91 | REPO_URL_OPENSTACK = {env:REPO_URL_OPENSTACK:https://github.com/openstack} |
| 92 | commands = |
| 93 | gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed |
| 94 | gifn_apply -v -p {toxinidir}/../../patches -P {toxinidir}/sh/git-if-needed -s series.experimental |