Files
Takashi Kajinami 746ff44937 Remove duplicated optional dependencies from test requirements
... and use extras to define these, instead.

Change-Id: I6f04f5d09cffc825d336d5a11bf27370bbf69004
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2026-07-12 22:32:24 +09:00

108 lines
2.4 KiB
INI

[tox]
minversion = 4.28.0
envlist = py3,py{311,312,313,314}-{zookeeper,redis,sentinel,memcached,postgresql,mysql,etcd3gw,kubernetes},pep8
[testenv]
constraints =
{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
extras =
etcd3gw
redis
postgresql
mysql
zookeeper
memcached
ipc
kubernetes
setenv =
TOOZ_TEST_URLS = file:///tmp ipc://
zookeeper: TOOZ_TEST_DRIVERS = zookeeper
redis: TOOZ_TEST_DRIVERS = redis
sentinel: TOOZ_TEST_DRIVERS = redis --sentinel
sentinel: TOOZ_TEST_SENTINEL = 1
memcached: TOOZ_TEST_DRIVERS = memcached
mysql: TOOZ_TEST_DRIVERS = mysql
postgresql: TOOZ_TEST_DRIVERS = postgresql
etcd3gw: TOOZ_TEST_DRIVERS = etcd
etcd3gw: TOOZ_TEST_ETCD3GW = 1
kubernetes: TOOZ_TEST_DRIVERS = kubernetes
allowlist_externals =
{toxinidir}/run-tests.sh
commands =
{toxinidir}/run-tests.sh stestr run "{posargs}"
passenv =
ETCD_VERSION
[testenv:venv]
# This target is used by the gate go run Sphinx to build the doc
deps = {[testenv:docs]deps}
commands = {posargs}
[testenv:examples]
allowlist_externals =
{toxinidir}/run-examples.sh
commands =
{toxinidir}/run-examples.sh
[testenv:cover]
deps = {[testenv]deps}
setenv = {[testenv]setenv}
PYTHON=coverage run --source tooz --parallel-mode
commands =
coverage erase
{toxinidir}/run-tests.sh stestr run "{posargs}"
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report --show-missing
[testenv:docs]
deps =
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W -b html doc/source doc/build/html
[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:pep8]
description =
Run style checks.
deps =
pre-commit
{[testenv:mypy]deps}
commands =
pre-commit run -a
{[testenv:mypy]commands}
[testenv:mypy]
description =
Run type checks.
deps =
{[testenv]deps}
mypy
msgpack-types
types-PyMySQL
types-psycopg2
types-requests
commands =
mypy --cache-dir="{envdir}/mypy_cache" {posargs:tooz}
[flake8]
# We only enable the hacking (H) checks
select = H
show-source = true
exclude = .venv,.git,.tox,dist,*egg,*.egg-info,build,examples,doc
[hacking]
import_exceptions =
collections.abc
typing
typing_extensions