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. # process, which may cause wedges in the gate later.
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD 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 logging
import os import os
import sys import sys
from sphinx import apidoc
import django import django
@ -39,6 +38,7 @@ extensions = [
# 'sphinx.ext.intersphinx', # 'sphinx.ext.intersphinx',
'sphinx.ext.todo', 'sphinx.ext.todo',
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'sphinxcontrib.apidoc'
] ]
# autodoc generation is a bit aggressive and a nuisance when doing heavy # 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. # A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['neutron-lbaas-dashboard.'] modindex_common_prefix = ['neutron-lbaas-dashboard.']
apidoc_output_dir = 'contributor/modules'
# TODO(mordred) We should extract this into a sphinx plugin apidoc_module_dir = '../../neutron_lbaas_dashboard'
def run_apidoc(_): apidoc_excluded_paths = [
cur_dir = os.path.abspath(os.path.dirname(__file__)) 'tests',
out_dir = os.path.join(cur_dir, 'contributor', 'modules') 'enabled',
module = os.path.join(cur_dir, '..', '..', 'neutron_lbaas_dashboard') 'locale',
# Keep the order of arguments same as the sphinx-apidoc help, otherwise it 'static',
# would cause unexpected errors: 'post_install.sh'
# sphinx-apidoc [options] -o <output_path> <module_path> 'karma.conf.js'
# [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)

View File

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