burnham/application/tox.ini

61 строка
1.7 KiB
INI

[tox]
envlist = black, flake8, mypy, glinter, py310
isolated_build = False
[testenv]
# Use Python 3.10 for all test environments
basepython = python3.10
# Do not install burnham
skip_install = True
# We use pip-tools to install compatible packages
deps = pip-tools
commands_pre =
# Install the pinned burnham and development requirements
pip-sync {toxinidir}/requirements.txt {toxinidir}/dev-requirements.txt
# Build the burnham wheel and install it without package dependencies to
# ensure we use the pinned requirements rather than relying on pip to
# automatically resolve any version conflicts
pip install --no-deps .
# Verify installed packages have compatible dependencies
pip check -v
commands =
# Run the unit tests and report the current code coverage
coverage erase
coverage run -m pytest -v {posargs:tests}
coverage combine
coverage report
[testenv:black]
commands_pre =
# Install the pinned development requirements
pip-sync {toxinidir}/dev-requirements.txt
commands =
black --check --diff setup.py src/ tests/
[testenv:flake8]
commands_pre =
# Install the pinned development requirements
pip-sync {toxinidir}/dev-requirements.txt
commands =
flake8
[flake8]
max-line-length = 88
[testenv:mypy]
commands_pre =
# Install the pinned development requirements
pip-sync {toxinidir}/dev-requirements.txt
commands =
mypy setup.py src/ tests/
[testenv:glinter]
commands_pre =
# Install the pinned burnham requirements
pip-sync {toxinidir}/requirements.txt
commands =
glean_parser glinter --require-tags src/burnham/config/metrics.yaml src/burnham/config/pings.yaml src/burnham/config/tags.yaml