This is not perfect as mypy at least doesn't consider e.g. subclasses of the property decorator class to behave the same way, but it's as good as we can get without introducing a mypy plugin. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: Ia0c4110218ce8a48c3ec5e720f07e45fc2b831bf
68 lines
1.5 KiB
INI
68 lines
1.5 KiB
INI
[tox]
|
|
minversion = 3.2.0
|
|
envlist = py3,pep8
|
|
|
|
[testenv]
|
|
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:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[testenv:pep8]
|
|
description =
|
|
Run style checks.
|
|
deps =
|
|
pre-commit
|
|
{[testenv:docs]deps}
|
|
{[testenv:mypy]deps}
|
|
commands =
|
|
pre-commit run -a
|
|
sphinx-build -b doctest doc/source doc/build
|
|
{[testenv:mypy]commands}
|
|
|
|
[testenv:mypy]
|
|
description =
|
|
Run type checks.
|
|
deps =
|
|
{[testenv]deps}
|
|
mypy
|
|
commands =
|
|
mypy --cache-dir="{envdir}/mypy_cache" {posargs:debtcollector}
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
PYTHON=coverage run --source $project --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands = sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html
|
|
|
|
[testenv:releasenotes]
|
|
deps = {[testenv:docs]deps}
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[flake8]
|
|
# We only enable the hacking (H) checks
|
|
select = H
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
|
|
|
[hacking]
|
|
import_exceptions =
|
|
collections.abc
|
|
typing
|