From 1e7a0c6fbb9782b7fc0216430e3a84e9249014f4 Mon Sep 17 00:00:00 2001
From: caoyuan <cao.yuan@99cloud.net>
Date: Thu, 24 Oct 2019 14:09:59 +0800
Subject: [PATCH] tox: Keeping going with docs

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.

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

Change-Id: If9885a1f064226909181d8b69241eb814deb2105
---
 doc/requirements.txt  |  4 ++--
 lower-constraints.txt |  2 +-
 tox.ini               | 10 ++++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/doc/requirements.txt b/doc/requirements.txt
index cb837c319..a6e137e7b 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -3,8 +3,8 @@
 # process, which may cause wedges in the gate later.
 
 openstackdocstheme>=1.20.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,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
+sphinx>=1.8.0,<2.0.0;python_version=='2.7' # BSD
+sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD
 reno>=2.5.0 # Apache-2.0
 
 # imported when the source code is parsed for generating documentation:
diff --git a/lower-constraints.txt b/lower-constraints.txt
index ba7af9f5d..49feaa653 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -78,7 +78,7 @@ Routes==2.3.1
 six==1.10.0
 smmap==0.9.0
 snowballstemmer==1.2.1
-Sphinx==1.6.2
+Sphinx==1.8.0
 sphinxcontrib-websupport==1.0.1
 statsd==3.2.1
 stestr==2.0.0
diff --git a/tox.ini b/tox.ini
index 6f85dbbd4..f60580697 100644
--- a/tox.ini
+++ b/tox.ini
@@ -38,8 +38,11 @@ commands = {posargs}
 
 [testenv:docs]
 basepython = python3
+whitelist_externals = rm
 deps = -r{toxinidir}/doc/requirements.txt
-commands = sphinx-build -W -b html doc/source doc/build/html
+commands =
+  rm -fr doc/build
+  sphinx-build -W --keep-going -b html doc/source doc/build/html
 
 [testenv:py27-func-rabbit]
 basepython = python2.7
@@ -111,7 +114,10 @@ local-check-factory = oslo_messaging.hacking.checks.factory
 
 [testenv:releasenotes]
 basepython = python3
-commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
+whitelist_externals = rm
+commands =
+  rm -rf releasenotes/build
+  sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
 deps = -r{toxinidir}/doc/requirements.txt
 
 [testenv:bindep]