# SPDX-FileCopyrightText: 2021 - 2024 StorPool # SPDX-License-Identifier: BSD-2-Clause [tox] minversion = 4.1 envlist = ruff format mypy reuse docs unit-tests-pytest-6 unit-tests-pytest-7 unit-tests-pytest-8 isolated_build = True [defs] pyfiles = python/sp_build_repo \ python/sp_variant \ python/test_docker \ python/unit_tests [testenv:ruff] skip_install = True tags = check quick deps = -r python/requirements/ruff.txt commands = ruff check -- {[defs]pyfiles} [testenv:format] skip_install = True tags = check quick deps = -r python/requirements/ruff.txt commands = ruff check --config ruff-base.toml --select=D,I --diff -- {[defs]pyfiles} ruff format --check --config ruff-base.toml --diff -- {[defs]pyfiles} [testenv:reformat] skip_install = True tags = format manual deps = -r python/requirements/ruff.txt commands = ruff check --config ruff-base.toml --select=D,I --fix -- {[defs]pyfiles} ruff format --config ruff-base.toml -- {[defs]pyfiles} [testenv:mypy] skip_install = True tags = check deps = -r python/requirements/test-mypy.txt mypy >= 1.5, < 2 commands = mypy -- {[defs]pyfiles} [testenv:unit-tests-pytest-6] tags = tests deps = -r python/requirements/test-unit.txt pytest >= 6, < 7 commands = pytest {posargs} python/unit_tests [testenv:unit-tests-pytest-7] tags = tests deps = -r python/requirements/test-unit.txt pytest >= 7, < 8 commands = pytest {posargs} python/unit_tests [testenv:unit-tests-pytest-8] tags = tests deps = -r python/requirements/test-unit.txt pytest >= 8, < 9 commands = pytest {posargs} python/unit_tests [testenv:pyupgrade] skip_install = True tags = upgrade manual deps = pyupgrade >= 3, < 4 allowlist_externals = sh commands = sh -c 'pyupgrade --py38-plus python/sp_build_repo/*.py python/sp_variant/*.py python/test_docker/*.py python/unit_tests/*.py' # This should only be run when the working tree is clean [testenv:reuse] skip_install = True tags = check quick deps = reuse >= 2, < 3 commands = reuse lint [testenv:docs] skip_install = True tags = docs check deps = -r python/requirements/docs.txt commands = mkdocs build