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
changes/83/568383/1
Michael Johnson 5 years ago
parent d6c7e57835
commit 9c6e9e331b

@ -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

@ -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'
]

Loading…
Cancel
Save