Peter Pentchev | 096b843 | 2024-01-18 13:53:09 +0200 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: StorPool <support@storpool.com> |
| 2 | # SPDX-License-Identifier: BSD-2-Clause |
| 3 | |
| 4 | [tox] |
| 5 | minversion = 4.1 |
| 6 | envlist = |
| 7 | ruff |
| 8 | ruff-all |
| 9 | format |
| 10 | mypy |
| 11 | unit-tests |
| 12 | functional-cinder |
| 13 | isolated_build = true |
| 14 | |
| 15 | [defs] |
| 16 | pyfiles = |
| 17 | src/gifn_apply \ |
| 18 | tests/unit |
| 19 | |
| 20 | [testenv:format] |
| 21 | skip_install = True |
| 22 | tags = |
| 23 | check |
| 24 | deps = |
| 25 | -r requirements/ruff.txt |
| 26 | commands = |
Peter Pentchev | 01ad6a3 | 2024-02-20 10:16:00 +0200 | [diff] [blame] | 27 | ruff check --config config/ruff/base.toml --select=D,I --diff -- {[defs]pyfiles} |
| 28 | ruff format --check --config config/ruff/base.toml --diff -- {[defs]pyfiles} |
Peter Pentchev | 096b843 | 2024-01-18 13:53:09 +0200 | [diff] [blame] | 29 | |
| 30 | [testenv:reformat] |
| 31 | skip_install = True |
| 32 | tags = |
| 33 | format |
| 34 | manual |
| 35 | deps = |
| 36 | -r requirements/ruff.txt |
| 37 | commands = |
Peter Pentchev | 01ad6a3 | 2024-02-20 10:16:00 +0200 | [diff] [blame] | 38 | ruff check --config config/ruff/base.toml --select=D,I --fix -- {[defs]pyfiles} |
| 39 | ruff format --config config/ruff/base.toml -- {[defs]pyfiles} |
Peter Pentchev | 096b843 | 2024-01-18 13:53:09 +0200 | [diff] [blame] | 40 | |
| 41 | [testenv:mypy] |
| 42 | skip_install = True |
| 43 | tags = |
| 44 | check |
| 45 | deps = |
| 46 | -r requirements/test.txt |
| 47 | mypy >= 1, < 2 |
| 48 | commands = |
| 49 | mypy -- {[defs]pyfiles} |
| 50 | |
| 51 | [testenv:ruff] |
| 52 | skip_install = True |
| 53 | tags = |
| 54 | check |
| 55 | quick |
| 56 | deps = |
| 57 | -r requirements/ruff.txt |
| 58 | commands = |
Peter Pentchev | 01ad6a3 | 2024-02-20 10:16:00 +0200 | [diff] [blame] | 59 | ruff check --config config/ruff/all.toml -- {[defs]pyfiles} |
Peter Pentchev | 096b843 | 2024-01-18 13:53:09 +0200 | [diff] [blame] | 60 | |
| 61 | [testenv:unit-tests] |
| 62 | tags = |
| 63 | tests |
| 64 | deps = |
| 65 | -r requirements/test.txt |
| 66 | commands = |
| 67 | pytest {posargs} tests/unit |
| 68 | |
| 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 | |
| 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 |