Update tox template

Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
This commit is contained in:
2023-01-09 08:27:08 +00:00
committed by zuul
parent 641ec7ddd2
commit 07b3c97d7d
3 changed files with 18 additions and 4 deletions

View File

@ -21,8 +21,14 @@ deps =
-r{toxinidir}/requirements.txt
commands = {posargs}
# This env is invoked in the periodic pipeline and is therefore responsible to
# build all relevant docs at once.
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
allowlist_externals =
mkdir
cp
sh
commands =
{%- for doc in docs %}
{[testenv:{{ doc.type }}]commands}
@ -32,7 +38,11 @@ commands =
[testenv:docs-pdf]
deps = -r{toxinidir}/doc/requirements.txt
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
mkdir -p doc/build/pdf
{%- for doc in docs %}
@ -68,11 +78,12 @@ deps = -r{toxinidir}/doc/requirements.txt
allowlist_externals =
cp
mkdir
find
sh
commands =
sphinx-build -W --keep-going -b json {{ loc }}/source doc/build/json/{{ doc.type }}
# Drop data useless for the search
find doc/build/json -type d -and ( -name '_images' -or -name '_static' -or -name '_sources' ) -exec rm {:} ;
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
{%- if doc.type == 'api-ref' %}
mkdir -p api-ref/build/json
cp -av doc/build/json/api-ref api-ref/build/json