2019-11-05 16:30:52 +03:00
|
|
|
[tox]
|
2022-07-12 14:17:14 +03:00
|
|
|
envlist = black, flake8, mypy, glinter, py310
|
2020-10-30 13:39:03 +03:00
|
|
|
isolated_build = False
|
|
|
|
|
|
|
|
[testenv]
|
2022-07-12 14:17:14 +03:00
|
|
|
# Use Python 3.10 for all test environments
|
|
|
|
basepython = python3.10
|
2020-10-30 13:39:03 +03:00
|
|
|
|
|
|
|
# Do not install burnham
|
|
|
|
skip_install = True
|
|
|
|
|
|
|
|
# We use pip-tools to install compatible packages
|
|
|
|
deps = pip-tools
|
2019-11-05 16:30:52 +03:00
|
|
|
|
2020-10-30 13:39:03 +03:00
|
|
|
commands_pre =
|
|
|
|
# Install the pinned burnham and development requirements
|
|
|
|
pip-sync {toxinidir}/requirements.txt {toxinidir}/dev-requirements.txt
|
2020-11-03 13:29:00 +03:00
|
|
|
# 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 .
|
2020-11-03 22:05:04 +03:00
|
|
|
# Verify installed packages have compatible dependencies
|
|
|
|
pip check -v
|
2020-10-21 13:15:25 +03:00
|
|
|
commands =
|
2020-10-30 13:39:03 +03:00
|
|
|
# Run the unit tests and report the current code coverage
|
2020-10-21 13:15:25 +03:00
|
|
|
coverage erase
|
|
|
|
coverage run -m pytest -v {posargs:tests}
|
|
|
|
coverage combine
|
|
|
|
coverage report
|
2019-11-05 16:30:52 +03:00
|
|
|
|
2020-11-02 15:06:52 +03:00
|
|
|
[testenv:black]
|
|
|
|
commands_pre =
|
|
|
|
# Install the pinned development requirements
|
|
|
|
pip-sync {toxinidir}/dev-requirements.txt
|
|
|
|
commands =
|
2022-01-25 13:51:41 +03:00
|
|
|
black --check --diff setup.py src/ tests/
|
2020-11-02 15:06:52 +03:00
|
|
|
|
2019-11-05 16:30:52 +03:00
|
|
|
[testenv:flake8]
|
2020-10-30 13:39:03 +03:00
|
|
|
commands_pre =
|
|
|
|
# Install the pinned development requirements
|
|
|
|
pip-sync {toxinidir}/dev-requirements.txt
|
|
|
|
commands =
|
|
|
|
flake8
|
2019-11-05 16:30:52 +03:00
|
|
|
|
2020-10-20 17:53:15 +03:00
|
|
|
[flake8]
|
|
|
|
max-line-length = 88
|
|
|
|
|
2019-11-05 16:30:52 +03:00
|
|
|
[testenv:mypy]
|
2020-10-30 13:39:03 +03:00
|
|
|
commands_pre =
|
|
|
|
# Install the pinned development requirements
|
|
|
|
pip-sync {toxinidir}/dev-requirements.txt
|
|
|
|
commands =
|
2020-10-23 19:17:56 +03:00
|
|
|
mypy setup.py src/ tests/
|
2021-10-28 16:56:41 +03:00
|
|
|
|
|
|
|
[testenv:glinter]
|
2021-11-02 15:17:23 +03:00
|
|
|
commands_pre =
|
|
|
|
# Install the pinned burnham requirements
|
|
|
|
pip-sync {toxinidir}/requirements.txt
|
2021-10-28 16:56:41 +03:00
|
|
|
commands =
|
2021-10-26 16:57:44 +03:00
|
|
|
glean_parser glinter --require-tags src/burnham/config/metrics.yaml src/burnham/config/pings.yaml src/burnham/config/tags.yaml
|