mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Keep using newest versions of build tools, but don't use pre-releases: * less downloading (with chances of failures) happens in the CI because versions change less often * tools are less likely to break the build (or at least it happens less often) This change should not affect the software under test as we install pinned versions of those. Note that this also doesn't affect black: tox still ends up with a pre-release version of black because that project has never made an actual release. Fixes #1350 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
53 lines
2 KiB
INI
53 lines
2 KiB
INI
# 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]
|
|
envlist = lint,py{36,37,38,39}
|
|
skipsdist = true
|
|
|
|
[testenv]
|
|
# TODO: Consider refactoring the tests to not require the aggregation script
|
|
# being invoked from the `tests` directory. This seems to be the convention and
|
|
# would make use of other testing tools such as coverage/coveralls easier.
|
|
changedir = tests
|
|
|
|
commands =
|
|
python --version
|
|
python -m coverage run aggregate_tests.py
|
|
python -m coverage report -m --fail-under 97
|
|
|
|
deps =
|
|
-r{toxinidir}/requirements-test.txt
|
|
# Install TUF in editable mode, instead of tox default virtual environment
|
|
# installation (see `skipsdist`), to get relative paths in coverage reports
|
|
--editable {toxinidir}
|
|
|
|
install_command = pip install {opts} {packages}
|
|
|
|
# Develop test env to run tests against securesystemslib's master branch
|
|
# Must to be invoked explicitly with, e.g. `tox -e with-sslib-master`
|
|
[testenv:with-sslib-master]
|
|
deps =
|
|
git+https://github.com/secure-systems-lab/securesystemslib.git@master#egg=securesystemslib[crypto,pynacl]
|
|
-r{toxinidir}/requirements-test.txt
|
|
--editable {toxinidir}
|
|
|
|
commands =
|
|
python -m coverage run aggregate_tests.py
|
|
python -m coverage report -m
|
|
|
|
[testenv:lint]
|
|
commands =
|
|
# Use different configs for new (tuf/api/*) and legacy code
|
|
# TODO: configure black and isort args in pyproject.toml (see #1161)
|
|
black --check --diff --line-length 80 {toxinidir}/tuf/api
|
|
isort --check --diff --line-length 80 --profile black -p tuf {toxinidir}/tuf/api
|
|
pylint {toxinidir}/tuf/api --rcfile={toxinidir}/tuf/api/pylintrc
|
|
|
|
# NOTE: Contrary to what the pylint docs suggest, ignoring full paths does
|
|
# work, unfortunately each subdirectory has to be ignored explicitly.
|
|
pylint {toxinidir}/tuf --ignore={toxinidir}/tuf/api,{toxinidir}/tuf/api/serialization
|
|
|
|
bandit -r {toxinidir}/tuf
|