Skip to content

Commit

Permalink
Bindeps (#276)
Browse files Browse the repository at this point in the history
Bindeps

Reviewed-by: Tino Schr
  • Loading branch information
SebastianGode authored Dec 18, 2024
1 parent 7ed09f4 commit 6f3a724
Showing 1 changed file with 46 additions and 9 deletions.
55 changes: 46 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,56 @@ commands =
sphinx-build -a -E -W -d api-ref/build/doctrees -b html api-ref/source api-ref/build/html

[testenv:pdf-docs]
envdir = {toxworkdir}/docs
deps =
{[testenv:docs]deps}
{[testenv:bindeps]deps}
allowlist_externals =
rm
mkdir
wget
make
bash
cp
commands =
mkdir -p doc/build/pdf
{[testenv:bindeps]commands}
mkdir -p {toxinidir}/_templates
wget -O {toxinidir}/_templates/longtable.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/longtable.tex.jinja
wget -O {toxinidir}/_templates/tabular.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/tabular.tex.jinja
wget -O {toxinidir}/_templates/tabulary.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/tabulary.tex.jinja
{[testenv:doc-pdf-docs]commands}

# PDF version
[testenv:doc-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/build/pdf
sphinx-build -a -E -W -b latex doc/source doc/build/pdf
cp -r {toxinidir}/_templates doc/source/_templates/
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf/
bash -c "for f in doc/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/build/pdf

[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test
[testenv:bindeps]
deps =
bindep
allowlist_externals =
wget
rm
bash
commands =
rm -rf {toxinidir}/bindep.txt
rm -rf {toxinidir}/packages.txt
wget -O {toxinidir}/bindep.txt https://raw.githubusercontent.com/opentelekomcloud/otcdocstheme/main/bindep.txt
bash -c "bindep test -b -f {toxinidir}/bindep.txt > {toxinidir}/packages.txt || true"
bash -c 'if [ -s {toxinidir}/packages.txt ]; then if command -v apt &>/dev/null; then apt update && xargs apt install --no-install-recommends -y < {toxinidir}/packages.txt; fi; fi'
bash -c 'if [ -s {toxinidir}/packages.txt ]; then if command -v dnf &>/dev/null; then dnf install -y $(cat {toxinidir}/packages.txt); fi; fi'

[flake8]
exclude=.venv,.git,.tox,dist,doc,api-ref,*lib/python*,*egg,tools
Expand Down

0 comments on commit 6f3a724

Please sign in to comment.