
This illustrates the use of nox in a simpler project. It can build docs, run linters, and execute unittests simply and effectively. Note we pin the packaging package as newer versions have changed behavior on rolling release distros that don't have proper version. This is necessary to fix gating. The followup change fixes it properly. Change-Id: I795e4d73f60d90b0f027df43a80ebda773ee9194
44 lines
872 B
INI
44 lines
872 B
INI
[tox]
|
|
min_version = 3.1
|
|
envlist = py3,py27,pep8
|
|
skipsdist = True
|
|
ignore_basepython_conflict=true
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
basepython = python3
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
deps =
|
|
hacking>=3.2.0,<3.3
|
|
commands = flake8
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
{[testenv]setenv}
|
|
PYTHON=coverage run --source bindep --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
|