tox: Keeping going with docs

1. Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.
2. Remove the exists folder before run sphinx-build command

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: I1b1b45bf3ae104defbb16282e18995a28f67f649
This commit is contained in:
gujin 2019-11-01 11:39:07 +08:00 committed by gugug
parent 7448258c99
commit 676b38a9ad
3 changed files with 11 additions and 6 deletions

View File

@ -10,6 +10,5 @@
mock>=2.0.0 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
sphinx>=1.8.0,!=2.1.0 # BSD
sphinxcontrib-apidoc>=0.2.0 # BSD

View File

@ -89,7 +89,7 @@ semantic-version==2.6.0
simplejson==3.13.2
six==1.11.0
snowballstemmer==1.2.1
Sphinx==1.6.2
Sphinx==1.8.0
sphinxcontrib-apidoc===0.2.0
sphinxcontrib-websupport==1.0.1
stevedore==1.28.0

12
tox.ini
View File

@ -83,11 +83,14 @@ commands =
[testenv:docs]
basepython = python3
whitelist_externals =
rm
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands=
sphinx-build -W -b html doc/source doc/build/html
rm -rf doc/build
sphinx-build -W --keep-going -b html doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
@ -96,7 +99,7 @@ deps = {[testenv:docs]deps}
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:docs-local]
@ -109,10 +112,13 @@ commands=
[testenv:releasenotes]
basepython = python3
whitelist_externals =
rm
deps =
{[testenv:docs]deps}
commands =
sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
rm -rf releasenotes/build
sphinx-build -a -E -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[testenv:lower-constraints]
basepython = python3