Files
grian-ui/tox.ini
Sean Mooney 93aa237b55 add releasenote and docs config
This change stubs out the docs and release note
structure and set up the inintal jobs to build
and publish docs and releasenotes.

This invovle adding a bindep.txt to capture
the binary packages requried for html and pdf docs,
extending tox with the standard docs targets,
provideing a doc/requirement.txt to track the
doc only python deps and a standard folder structure.

Change-Id: Iffbef50ab806688a6d62f27ab60fa824edcb3d09
2025-05-19 15:35:47 +00:00

113 lines
3.3 KiB
INI

[tox]
minversion = 3.18.0
envlist = pep8,unit
[testenv]
usedevelop = True
allowlist_externals =
bash
find
rm
env
make
install_command = python -I -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=160
PYTHONDONTWRITEBYTECODE=1
deps =
-r{toxinidir}/test-requirements.txt
passenv =
# LOCALE_ARCHIVE is needed when not using python from the system package
# manager (e.g. when installed with nix) to ensure the locale-archive is
# available to the tests. specifically this is needed by sphinx to build
# the docs.
LOCALE_ARCHIVE
OS_DEBUG
GENERATE_HASHES
# Note(sean-k-mooney):
# leaking greanthreads between tests is a bug so we should fail if it happens
# however unlike greenthreads, greenlets cannot be killed via a test fixture.
# greenlet leaks will be annotated in the test details but will not cause a
# failure. if you want to make them raise set
# NOVA_RAISE_ON_GREENLET_LEAK=1|true|yes
# All leaks of green threads have been resolved in the unit and functional
# suite
NOVA_RAISE_ON_GREENLET_LEAK
# NOTE(sean-k-mooney) optimization is enabled by default and when enabled
# asserts are complied out. Disable optimization to allow asserts in
# nova to fire in unit and functional tests. This can be useful for
# debugging issue with fixtures and mocks.
PYTHONOPTIMIZE
# there is also secret magic in subunit-trace which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
TRACE_FAILONLY
commands =
stestr run {posargs}
stestr slowest
[testenv:pep8]
description =
Run style checks.
deps =
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:{unit,py3,py310,py311,py312,py313}]
set_env =
{[testenv]setenv}
[testenv:venv]
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
commands =
{posargs}
[testenv:releasenotes]
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:docs]
description =
Build all documentation including API guides and refs.
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W --keep-going -b html -j auto doc/source doc/build/html
[testenv:pdf-docs]
description =
Build PDF documentation.
deps = {[testenv:docs]deps}
extras =
commands =
rm -rf doc/build/pdf
sphinx-build -W --keep-going -b latex -j auto doc/source doc/build/pdf
make -C doc/build/pdf
[flake8]
# We only enable the hacking (H) and local checks (N)
select = H,N
filename = *.py,app.wsgi
show-source=True
# W504 line break after binary operator
# H301 Black will put commas after imports that can't fit on one line
# H404 Docstrings don't always start with a newline
# H405 Multiline docstrings are okay
# H105 disable blocking author tags
# H202 assertRaises Exception too broad
# H104: File contains nothing but comments
ignore = H301,H403,H404,H405,H105,H202,H104
builtins= _
enable-extensions = H106,H203,H904
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/,releasenotes