1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
# Tox (https://tox.readthedocs.io/en/latest/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
isolated_build=true
envlist = lint,docs,py
skipsdist = true
[testenv]
commands =
python3 --version
python3 -m coverage run -m unittest
python3 -m coverage report -m --fail-under 97
deps =
-r{toxinidir}/requirements/test.txt
install_command = python3 -m pip install {opts} {packages}
# Workaround https://github.com/tox-dev/tox/issues/2801 (python3 not allowed in Windows)
allowlist_externals = python3
# Develop test env to run tests against securesystemslib's main branch
# Must to be invoked explicitly with, e.g. `tox -e with-sslib-main`
[testenv:with-sslib-main]
commands_pre =
python3 -m pip install --force-reinstall git+https://github.com/secure-systems-lab/securesystemslib.git@main#egg=securesystemslib[crypto]
commands =
python3 -m coverage run -m unittest
python3 -m coverage report -m
[testenv:lint]
deps =
-r{toxinidir}/requirements/lint.txt
lint_dirs = tuf examples tests verify_release .github/scripts
passenv = RUFF_OUTPUT_FORMAT
commands =
ruff check {[testenv:lint]lint_dirs}
ruff format --diff {[testenv:lint]lint_dirs}
mypy {[testenv:lint]lint_dirs}
zizmor --persona=pedantic -q .
[testenv:fix]
deps = {[testenv:lint]deps}
commands =
ruff check --fix {[testenv:lint]lint_dirs}
ruff format {[testenv:lint]lint_dirs}
[testenv:docs]
deps =
-r{toxinidir}/requirements/docs.txt
commands =
sphinx-build --fail-on-warning --quiet --builder html docs docs/build/html
|