From 008dbec2ad45c6c68ae278a3f433cea1c754eece Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Wed, 16 May 2018 00:35:36 -0700 Subject: [PATCH] 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 --- doc/requirements.txt | 1 + doc/source/conf.py | 26 +++++--------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 1ade022a..467e8203 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -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 diff --git a/doc/source/conf.py b/doc/source/conf.py index 1f18a18b..2d5c49ff 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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 - # [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 = []