training-guides/tox.ini
Andreas Jaeger e43daab321 Update to hieroglyph 2.0
hieroglyph 2.0 works with python 3 and Sphinx 2, update to it.
Update some other requirements as well.

Cleanup tox.ini a bit.

Switch to openstackdocstheme 2.2.1 version. Using
this versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Disable openstackdocs_auto_version to not auto-version the documents.

Disable openstackdocs_auto_name to use 'project' variable as name.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: Ib8ba3e3f514688d06a07598e7d6ceffa79f26220
2020-06-27 20:22:30 +02:00

69 lines
2.5 KiB
INI

[tox]
minversion = 3.1.1
envlist = publishdocs
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals =
mkdir
rm
rsync
bash
[testenv:venv]
commands = {posargs}
[doc8]
# Settings for doc8:
# File extensions to use
extension = .rst,.txt
ignore-path = doc/upstream-training/build/*,doc/training-guides/build/*
[testenv:generatepot-training]
# Generate POT files for translation
commands =
rm -f doc/upstream-training/source/locale/upstream-training.pot
sphinx-build -b gettext doc/upstream-training/source/slides \
doc/upstream-training/source/locale/
sphinx-build -b gettext doc/upstream-training/source/website \
doc/upstream-training/source/locale/
bash -c "msgcat --use-first --sort-by-file doc/upstream-training/source/locale/*.pot | \
awk '$0 !~ /^\# [a-z0-9]+$/' > doc/upstream-training/source/upstream-training.pot && \
rm doc/upstream-training/source/locale/*.pot && \
rm -rf doc/upstream-training/source/locale/.doctrees/ && \
mv doc/upstream-training/source/upstream-training.pot doc/upstream-training/source/locale/upstream-training.pot"
[testenv:publishdocs]
# These are needed for writing the root-marker
passenv = ZUUL*
commands =
{[testenv:upstream-slides]commands}
# Publish
mkdir -p publish-docs/html/upstream-training
rsync -av doc/upstream-training/build/slides/ publish-docs/html/upstream-training/
{toxinidir}/tools/add-marker.sh publish-docs/html/upstream-training
# Publish translated guides
{toxinidir}/tools/buildlang.sh
[testenv:upstream-slides]
commands =
# Niceness test
doc8 doc/upstream-training
# Build upstream-training slides
sphinx-build -W -b slides -d doc/upstream-training/build/slides.doctrees doc/upstream-training/source/slides doc/upstream-training/build/slides
# Build upstream landing page index.html
sphinx-build -W -b html -d doc/upstream-training/build/slides.doctrees doc/upstream-training/source/website doc/upstream-training/build/slides
[testenv:training-slides]
commands =
# Niceness test
doc8 doc/training-guides
# Build training-guides slides
sphinx-build -W -b slides -d doc/training-guides/build/slides.doctrees/associate-guide doc/training-guides/source/slides doc/training-guides/build/slides/associate-guide
# Build training-guides landing page index.html
sphinx-build -b html -d doc/training-guides/build/slides.doctrees doc/training-guides/source/website doc/training-guides/build/slides