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: I1df20c2de6523c46e8bd0facbc5f7404d20a9bf2
This commit is contained in:
manchandavishal 2019-04-05 06:11:07 +00:00 committed by Vishal Manchanda
parent 8630dfe40e
commit 06233c60fa
3 changed files with 13 additions and 27 deletions

View File

@ -3,3 +3,4 @@
# process, which may cause wedges in the gate later.
openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
sphinxcontrib-apidoc>=0.2.1 # BSD

View File

@ -15,7 +15,6 @@
import logging
import os
import sys
from sphinx import apidoc
import django
@ -39,6 +38,7 @@ extensions = [
# 'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinxcontrib.apidoc'
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
@ -103,29 +103,13 @@ latex_documents = [
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['neutron-lbaas-dashboard.']
# 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, '..', '..', 'neutron_lbaas_dashboard')
# 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,
'neutron_lbaas_dashboard/tests',
'neutron_lbaas_dashboard/enabled',
'neutron_lbaas_dashboard/locale',
'neutron_lbaas_dashboard/static',
'neutron_lbaas_dashboard/post_install.sh',
'neutron_lbaas_dashboard/karma.conf.js'
])
def setup(app):
app.connect('builder-inited', run_apidoc)
apidoc_output_dir = 'contributor/modules'
apidoc_module_dir = '../../neutron_lbaas_dashboard'
apidoc_excluded_paths = [
'tests',
'enabled',
'locale',
'static',
'post_install.sh'
'karma.conf.js'
]

View File

@ -104,6 +104,7 @@ selenium==2.50.1
semantic-version==2.3.1
simplejson==3.5.1
six==1.10.0
sphinxcontrib-apidoc===0.2.1
statsd==3.2.1
stevedore==1.20.0
tenacity==3.2.1