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