Files
Takashi Kajinami e4f4760df3 Simplify coverage command options
... by defining these in pyproject.toml .

Change-Id: I659111e15c537b51df5756a849ad9004c576c216
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2026-10-04 15:59:44 +09:00

84 lines
1.7 KiB
INI

[tox]
minversion = 4.28.0
envlist = py3,pypy,pep8
[testenv]
usedevelop = True
setenv =
PYTHONDONTWRITEBYTECODE=1
constraints =
{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
-r{toxinidir}/test-requirements.txt
commands =
stestr run {posargs}
[testenv:pep8]
deps =
pre-commit
{[testenv:mypy]deps}
commands =
pre-commit run --all-files --show-diff-on-failure
{[testenv:mypy]commands}
[testenv:mypy]
description =
Run type checks.
deps =
{[testenv]deps}
mypy
commands =
mypy --cache-dir="{envdir}/mypy_cache" -p etcd3gw {posargs}
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run
deps =
{[testenv]deps}
coverage>=5.0 # Apache-2.0
commands =
coverage erase
{[testenv:py3-etcd]commands}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:examples]
commands =
pifpaf -e TOOZ_TEST run etcd -- python {toxinidir}/etcd3gw/examples/etcd.py
[testenv:docs]
deps =
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W -b html doc/source doc/build/html
[testenv:py{3,311,312,313,314}-etcd]
commands =
pifpaf -e TOOZ_TEST run etcd -- stestr run {posargs}
[testenv:releasenotes]
skip_install = true
deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
# We only enable the hacking (H) checks
select = H
show-source = True
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions =
collections.abc
typing