From 530bbea2ee40b39b1dc1d7c43fd99aadade22de5 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Sat, 6 Jul 2019 01:51:52 +0800 Subject: [PATCH] Move doc related modules to doc/requirements.txt Change-Id: I2f12fb5058984c1fc6beda4d13f934dd9b218218 --- .gitignore | 2 ++ doc/requirements.txt | 10 ++++++++++ doc/source/conf.py | 5 +++++ doc/source/reference/index.rst | 2 +- test-requirements.txt | 7 ------- tox.ini | 11 ++++++++++- 6 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 doc/requirements.txt diff --git a/.gitignore b/.gitignore index 25648c22..5b02d635 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ doc/build # 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 00000000..c8435638 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,10 @@ +# 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.5,<2.0.0;python_version=='2.7' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.5;python_version>='3.4' # BSD +sphinxcontrib-apidoc>=0.2.0 # BSD + +reno>=2.5.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index f7d542a7..0a9e2030 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -23,6 +23,7 @@ sys.path.insert(0, os.path.abspath('../..')) extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.extlinks', + 'sphinxcontrib.apidoc', #'sphinx.ext.intersphinx', 'openstackdocstheme', 'oslo_config.sphinxext', @@ -95,3 +96,7 @@ extlinks = { # Example configuration for intersphinx: refer to the Python standard library. #intersphinx_mapping = {'http://docs.python.org/': None} + +# -- sphinxcontrib.apidoc configuration -------------------------------------- +apidoc_module_dir = '../../oslo_policy' +apidoc_output_dir = 'reference/api' diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index a345d32a..62844507 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -4,5 +4,5 @@ .. toctree:: - api/autoindex + api/modules diff --git a/test-requirements.txt b/test-requirements.txt index 04c09a37..81039130 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,12 +10,5 @@ oslo.context>=2.22.0 # Apache-2.0 # computes code coverage percentages coverage!=4.4,>=4.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.5,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,>=1.6.5;python_version>='3.4' # BSD - -reno>=2.5.0 # Apache-2.0 - # Bandit security code scanner bandit>=1.1.0,<1.6.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 7972751f..721d026e 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt commands = stestr run --slowest {posargs} [testenv:py27] @@ -28,7 +29,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 + sphinx-build -W -b html doc/source doc/build/html [testenv:cover] basepython = python3 @@ -54,3 +62,4 @@ deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt