Files
Stephen Finucane 7d82840705 Run mypy from tox
This avoids the need to duplicate our dependency list in multiple
places and allows us to take advantage of tox's dependency management
infrastructure, to ensure we always get the latest and greatest version
of a package allowed by upper-constraints

We also fix a minor typing issues that enabling type hints for tests
highlighted and add the 'Typing :: Typed' classifier.

Change-Id: I2250e7c20460e95154a3a0954474f3c5b6b5c8bb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2026-01-05 15:20:10 +00:00

71 lines
1.5 KiB
INI

[tox]
minversion = 4.6.0
envlist = py3,pep8,docs
[testenv]
setenv =
PYTHONWARNINGS=default::DeprecationWarning
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
stestr run --slowest {posargs}
[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
types-requests
commands =
mypy --cache-dir="{envdir}/mypy_cache" {posargs:os_service_types}
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
PYTHON=coverage run --source os_service_types --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:releasenotes]
deps =
{[testenv:docs]deps}
commands =
sphinx-build -a -E -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = typing,typing_extensions