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: I116c520cffe74da0477f0e436b5bc3a9f2af905b
This commit is contained in:
Adam Harwell 2018-05-16 00:35:36 -07:00
parent 8e86e9c439
commit 008dbec2ad
2 changed files with 6 additions and 21 deletions

View File

@ -2,6 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
sphinxcontrib-apidoc # BSD
sphinx>=1.6.2,!=1.6.6,!=1.6.7 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0

View File

@ -16,7 +16,6 @@ import os
import sys
import openstackdocstheme
from sphinx import apidoc
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('.'))
@ -29,7 +28,8 @@ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'openstackdocstheme',
'oslo_config.sphinxext'
'oslo_config.sphinxext',
'sphinxcontrib.apidoc'
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
@ -98,22 +98,6 @@ repository_name = 'openstack/octavia-tempest-plugin'
bug_project = '910'
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, '_build', 'modules')
module = os.path.join(cur_dir, '..', '..', 'octavia_tempest_plugin')
# 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,
])
def setup(app):
app.connect('builder-inited', run_apidoc)
apidoc_output_dir = '_build/modules'
apidoc_module_dir = '../../octavia_tempest_plugin'
apidoc_excluded_paths = []