Fix sphinx-docs job for sphinx >1.7

Upper requirements recently bumped sphinx from 1.6.5 to 1.7.4 which
breaks our docs job. This switches the apidocs build to use
sphinxcontrib.apidoc.

Change-Id: If6b9aa070d37f2799623a24a8e18666b13ef9044
This commit is contained in:
Michael Johnson 2018-05-14 14:17:39 -07:00
parent d6c7e57835
commit 9c6e9e331b
2 changed files with 9 additions and 24 deletions

View File

@ -4,6 +4,7 @@
# Docs
os-api-ref>=1.4.0 # Apache-2.0
sphinxcontrib-actdiag>=0.8.5 # BSD
sphinxcontrib-apidoc # BSD
sphinxcontrib-blockdiag>=1.5.4 # BSD
sphinxcontrib-nwdiag>=0.9.5 # BSD
sphinxcontrib-seqdiag>=0.8.4 # BSD

View File

@ -18,7 +18,6 @@ import sys
import openstackdocstheme
from pydotplus import graphviz
import sadisplay
from sphinx import apidoc
import octavia.db.models as models
@ -65,7 +64,8 @@ extensions = [
'sphinx.ext.graphviz',
'openstackdocstheme',
'oslo_config.sphinxext',
'oslo_policy.sphinxpolicygen'
'oslo_policy.sphinxpolicygen',
'sphinxcontrib.apidoc'
]
todo_include_todos = True
@ -335,25 +335,9 @@ repository_name = 'openstack/octavia'
bug_project = '908'
bug_tag = 'docs'
# TODO(mordred) We should extract this into a sphinx plugin
def run_apidoc(_):
cur_dir = os.path.abspath(os.path.dirname(__file__))
out_dir = os.path.join(cur_dir, 'contributor', 'modules')
module = os.path.join(cur_dir, '..', '..', 'octavia')
# Keep the order of arguments same as the sphinx-apidoc help, otherwise it
# would cause unexpected errors:
# sphinx-apidoc [options] -o <output_path> <module_path>
# [exclude_pattern, ...]
apidoc.main([
'--force',
'-o',
out_dir,
module,
'octavia/tests',
'octavia/db/migration'
])
def setup(app):
app.connect('builder-inited', run_apidoc)
apidoc_output_dir = 'contributor/modules'
apidoc_module_dir = '../../octavia'
apidoc_excluded_paths = [
'tests',
'db/migration'
]