From cf870ae5108d7e0f03bcb2d4c41515b919bc51a6 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Tue, 9 Jun 2020 15:08:10 -0700 Subject: Fix apidoc build Change-Id: Id7c5686cdbdc79812e06eb4a5f87eddc75005cc3 --- doc/requirements.txt | 5 +++++ doc/source/conf.py | 9 +++++++++ doc/source/contributor/index.rst | 2 +- test-requirements.txt | 5 +---- tox.ini | 4 ++++ 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 00000000..64d6a305 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,5 @@ +doc8>=0.6.0 # Apache-2.0 +sphinx>=2.0.0,!=2.1.0 # BSD +openstackdocstheme>=2.2.1 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 15feefce..f64921bb 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -4,6 +4,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', + 'sphinxcontrib.apidoc', 'openstackdocstheme', ] @@ -36,6 +37,14 @@ add_module_names = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' +# sphinxcontrib.apidoc options +apidoc_module_dir = '../../ironic_python_agent' +apidoc_output_dir = 'contributor/api' +apidoc_excluded_paths = [ + 'tests', +] +apidoc_separate_modules = True + # -- Options for HTML output -------------------------------------------------- diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst index 4f421637..bba5cbb3 100644 --- a/doc/source/contributor/index.rst +++ b/doc/source/contributor/index.rst @@ -29,7 +29,7 @@ Generated Developer Documentation .. toctree:: :hidden: - api/autoindex + api/modules Indices and tables ================== diff --git a/test-requirements.txt b/test-requirements.txt index a9d9d7a1..930dd4e6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,8 +10,5 @@ bashate>=0.5.1 # Apache-2.0 flake8-import-order>=0.17.1 # LGPLv3 bandit!=1.6.0,>=1.1.0,<2.0.0 # Apache-2.0 -# Doc requirements +# Doc test requirements doc8>=0.6.0 # Apache-2.0 -sphinx>=2.0.0,!=2.1.0 # BSD -openstackdocstheme>=2.2.1 # Apache-2.0 -reno>=3.1.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index de874a72..ea953482 100644 --- a/tox.ini +++ b/tox.ini @@ -62,6 +62,8 @@ commands = oslo_debug_helper -t ironic_python_agent/tests/unit {posargs} [testenv:docs] setenv = PYTHONHASHSEED=0 sitepackages = False +deps = + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -b html doc/source doc/build/html @@ -69,6 +71,8 @@ commands = whitelist_externals = make setenv = PYTHONHASHSEED=0 sitepackages = False +deps = + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -b latex doc/source doc/build/pdf make -C doc/build/pdf -- cgit v1.2.1