Browse Source

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
changes/33/650233/4
manchandavishal 2 years ago
committed by Vishal Manchanda
parent
commit
06233c60fa
  1. 1
      doc/requirements.txt
  2. 38
      doc/source/conf.py
  3. 1
      lower-constraints.txt

1
doc/requirements.txt

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

38
doc/source/conf.py

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

1
lower-constraints.txt

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

Loading…
Cancel
Save