Skip to content

Commit 63d741f

Browse files
committed
Replace pbr autodoc with sphinxcontrib-apidoc
This fixes local building of the documentation using tox, and allows the gate to stop relying on pbr and move completely to the new docs PTI. http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html Change-Id: I485acda07098a435753e91c1ca45e586de199c35
1 parent d6cf027 commit 63d741f

4 files changed

Lines changed: 16 additions & 27 deletions

File tree

doc/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# process, which may cause wedges in the gate later.
44
openstackdocstheme>=1.18.1 # Apache-2.0
55
reno>=2.5.0 # Apache-2.0
6-
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
6+
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
7+
sphinxcontrib-apidoc>=0.2.0 # BSD

doc/source/conf.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,8 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15-
import os
16-
import sys
17-
1815
import pbr.version
1916

20-
# If extensions (or modules to document with autodoc) are in another directory,
21-
# add these directories to sys.path here. If the directory is relative to the
22-
# documentation root, use os.path.abspath to make it absolute, like shown here.
23-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
24-
2517
# -- General configuration ----------------------------------------------------
2618

2719
# If your documentation needs a minimal Sphinx version, state it here.
@@ -35,6 +27,7 @@
3527
'openstackdocstheme',
3628
'stevedore.sphinxext',
3729
'cliff.sphinxext',
30+
'sphinxcontrib.apidoc',
3831
]
3932

4033
# openstackdocstheme options
@@ -282,3 +275,13 @@
282275
autoprogram_cliff_ignored = [
283276
'--help', '--format', '--column', '--max-width', '--fit-width',
284277
'--print-empty', '--prefix', '--noindent', '--quote']
278+
279+
280+
# -- Options for sphinxcontrib.apidoc ----------------------------------------
281+
282+
apidoc_module_dir = '../../openstackclient'
283+
apidoc_excluded_paths = [
284+
'volume/v3',
285+
'tests',
286+
]
287+
apidoc_output_dir = 'contributor/api'

setup.cfg

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -714,22 +714,6 @@ openstack.volume.v3 =
714714
volume_transfer_request_list = openstackclient.volume.v2.volume_transfer_request:ListTransferRequest
715715
volume_transfer_request_show = openstackclient.volume.v2.volume_transfer_request:ShowTransferRequest
716716

717-
[pbr]
718-
autodoc_tree_index_modules = True
719-
autodoc_tree_excludes =
720-
setup.py
721-
openstackclient/volume/v3
722-
openstackclient/tests/
723-
openstackclient/tests/*
724-
api_doc_dir = contributor/api
725-
726-
[build_sphinx]
727-
builders = html,man
728-
all-files = 1
729-
warning-is-error = 1
730-
source-dir = doc/source
731-
build-dir = doc/build
732-
733717
[upload_sphinx]
734718
upload-dir = doc/build/html
735719

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,13 @@ deps =
113113
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
114114
-r{toxinidir}/requirements.txt
115115
-r{toxinidir}/doc/requirements.txt
116-
commands = python setup.py build_sphinx
116+
commands =
117+
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
118+
sphinx-build -a -E -W -d doc/build/doctrees -b man doc/source doc/build/man
117119

118120
[testenv:releasenotes]
119121
deps =
120122
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
121-
-r{toxinidir}/requirements.txt
122123
-r{toxinidir}/doc/requirements.txt
123124
commands =
124125
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

0 commit comments

Comments
 (0)