Fix doc build

* Ensure doc is built with python3
* Ensures we don't install sphinx outside of doc build

Fixes sphinx requiring python3 issue

Change-Id: I2ef4c3c02e6af8c8b9891b39b59eec1a73c9a1dd
(cherry picked from commit efb015c143)
This commit is contained in:
Cédric Jeanneret 2019-05-20 08:26:35 +02:00
parent 4ef4e63947
commit 300a275611
3 changed files with 8 additions and 2 deletions

5
doc/requirements.txt Normal file
View File

@ -0,0 +1,5 @@
# Even if we do not build doc with python 2, we have to
# push that content due to some global check.
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
openstackdocstheme>=1.18.1 # Apache-2.0

View File

@ -6,12 +6,10 @@ hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0
coverage>=4.0,!=4.4 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx>=1.6.2 # BSD
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=1.4.0 # MIT
openstackdocstheme>=1.18.1 # Apache-2.0
# releasenotes
reno>=1.8.0 # Apache-2.0

View File

@ -30,10 +30,13 @@ commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py build_sphinx
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html