tox: Trivial cleanup

- Add some helpful descriptions for the various environments
- Use lower-case boolean values (they're prettier)
- Remove some unnecessary warning filters for issues not present on
  Python 3.6+
- Move the 'venv' target to the end of the file, indicating its priority
  (quite low)
- Fix a bit of wonky indentation

Change-Id: Ia083f959d2a9c974b4c0592fdada21dcc766dca4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2020-08-07 10:36:29 +01:00
parent f463abfc58
commit a7aa5a890c
1 changed files with 26 additions and 18 deletions

44
tox.ini
View File

@ -1,25 +1,23 @@
[tox]
minversion = 3.1.1
envlist = py36,py37,functional,pep8
skipsdist = True
skipsdist = true
# Automatic envs (pyXX) will use the python version appropriate to that
# env and ignore basepython inherited from [testenv]. That's what we
# want, and we don't need to be warned about it.
ignore_basepython_conflict = True
ignore_basepython_conflict = true
[testenv]
basepython = python3
usedevelop = True
usedevelop = true
whitelist_externals =
rm
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
PYTHONDONTWRITEBYTECODE=1
PYTHONDONTWRITEBYTECODE=1
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands = stestr run {posargs}
# NOTE(cdent): Do not set envdir here as it confuses tox-siblings.
@ -55,18 +53,14 @@ commands =
{[testenv:functional]commands}
[testenv:pep8]
description =
Run style checks.
envdir = {toxworkdir}/shared
commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}
# The docs requirements are included here for creating release notes, e.g.:
# tox -e venv -- reno new <slug>
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
[testenv:cover]
description =
Run unit tests with coverage enabled.
envdir = {toxworkdir}/shared
setenv =
{[testenv]setenv}
@ -80,6 +74,8 @@ commands =
coverage report
[testenv:docs]
description =
Build main documentation.
deps =
-r{toxinidir}/doc/requirements.txt
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
@ -88,6 +84,8 @@ commands =
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:pdf-docs]
description =
Build PDF documentation.
deps = {[testenv:docs]deps}
whitelist_externals =
make
@ -96,18 +94,28 @@ commands =
make -C doc/build/pdf
[testenv:releasenotes]
description =
Build release notes.
deps = {[testenv:docs]deps}
commands =
rm -rf releasenotes/build
sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html
[testenv:venv]
commands = {posargs}
# The docs requirements are included here for creating release notes, e.g.:
# tox -e venv -- reno new <slug>
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# W503 line break before binary operator
show-source = True
show-source = true
ignore = E123,E125,W503
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build