From f35e099910e64fc775497d735c8b6024c784332e Mon Sep 17 00:00:00 2001 From: caoyuan Date: Fri, 5 Jul 2019 15:33:54 +0800 Subject: [PATCH] Move doc related modules to doc/requirements.txt Change-Id: Ice407c712b5438b06c4f439c73946640a0c5a86c --- .gitignore | 2 ++ doc/requirements.txt | 9 +++++++++ doc/source/conf.py | 5 +++++ doc/source/reference/index.rst | 2 +- test-requirements.txt | 6 ------ tox.ini | 9 ++++++++- 6 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 doc/requirements.txt diff --git a/.gitignore b/.gitignore index 0d0a19e..878d6e1 100644 --- a/.gitignore +++ b/.gitignore @@ -57,4 +57,6 @@ doc/source/reference/api # reno build releasenotes/build +releasenotes/notes/reno.cache +RELEASENOTES.rst diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..1871350 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,9 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# 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,<2.0.0;python_version=='2.7' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD +reno>=2.5.0 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index a92994d..98e8907 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,6 +22,7 @@ sys.path.insert(0, os.path.abspath('../..')) # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', + 'sphinxcontrib.apidoc', #'sphinx.ext.intersphinx', 'openstackdocstheme', 'oslo_config.sphinxext', @@ -87,3 +88,7 @@ latex_documents = [ # Example configuration for intersphinx: refer to the Python standard library. #intersphinx_mapping = {'http://docs.python.org/': None} + +# -- sphinxcontrib.apidoc configuration -------------------------------------- +apidoc_module_dir = '../../oslo_reports' +apidoc_output_dir = 'reference/api' diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 9eb4867..6205029 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -15,4 +15,4 @@ API .. toctree:: :maxdepth: 1 - api/autoindex + api/modules diff --git a/test-requirements.txt b/test-requirements.txt index e4a7da3..dd7410a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,18 +6,12 @@ hacking>=1.1.0,<1.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 -# These are needed for docs generation -openstackdocstheme>=1.18.1 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD - # for testing optional parts oslo.config>=5.2.0 # Apache-2.0 eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT greenlet>=0.4.10 # MIT coverage!=4.4,>=4.0 # Apache-2.0 -reno>=2.5.0 # Apache-2.0 # Bandit security code scanner bandit>=1.1.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 42b46ba..48fea8f 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,14 @@ commands = {posargs} [testenv:docs] basepython = python3 -commands = python setup.py build_sphinx +whitelist_externals = + rm +deps = + {[testenv]deps} + -r{toxinidir}/doc/requirements.txt +commands = + rm -rf doc/build doc/source/reference/api + sphinx-build -W -b html doc/source doc/build/html [testenv:cover] basepython = python3