diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 00000000..4faabc1b --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,7 @@ +# 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 +reno>=2.5.0 # Apache-2.0 +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 98ab8c9c..7d181191 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -26,10 +26,18 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - 'sphinx.ext.autodoc', 'openstackdocstheme', + 'sphinxcontrib.apidoc', ] +# sphinxcontrib.apidoc options +apidoc_module_dir = '../../glanceclient' +apidoc_output_dir = 'reference/api' +apidoc_excluded_paths = [ + 'tests/*', + 'tests'] +apidoc_separate_modules = True + # openstackdocstheme options repository_name = 'openstack/python-glanceclient' bug_project = 'python-glanceclient' diff --git a/doc/source/index.rst b/doc/source/index.rst index 43ee57fe..31b921c2 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -3,7 +3,7 @@ ============================================== This is a client for the OpenStack Images API. There's :doc:`a Python -API ` (the :mod:`glanceclient` module) and a +API ` (the :mod:`glanceclient` module) and a :doc:`command-line script ` (installed as :program:`glance`). diff --git a/doc/source/reference/api/index.rst b/doc/source/reference/api/index.rst deleted file mode 100644 index df916b69..00000000 --- a/doc/source/reference/api/index.rst +++ /dev/null @@ -1,8 +0,0 @@ -====================== - Python API Reference -====================== - -.. toctree:: - :maxdepth: 2 - - autoindex diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 33ce8b24..7710a1f8 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -23,5 +23,5 @@ done so, you can use the API like so:: .. toctree:: :maxdepth: 2 - api/index + Python API Reference apiv2 diff --git a/setup.cfg b/setup.cfg index 8cf087e5..1cc748d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,21 +33,5 @@ setup-hooks = console_scripts = glance = glanceclient.shell:main -[build_sphinx] -builders = html,man -all-files = 1 -warning-is-error = 1 -source-dir = doc/source -build-dir = doc/build - -[upload_sphinx] -upload-dir = doc/build/html - [wheel] universal = 1 - -[pbr] -autodoc_index_modules = True -autodoc_exclude_modules = - glanceclient.tests.* -api_doc_dir = reference/api diff --git a/test-requirements.txt b/test-requirements.txt index 43987fa2..36381864 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,9 +6,6 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 mock>=2.0.0 # BSD os-client-config>=1.28.0 # Apache-2.0 -openstackdocstheme>=1.18.1 # Apache-2.0 -reno>=2.5.0 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD testrepository>=0.0.18 # Apache-2.0/BSD testtools>=2.2.0 # MIT testscenarios>=0.4 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 56da7d84..dd82c7c0 100644 --- a/tox.ini +++ b/tox.ini @@ -42,11 +42,14 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' coverage report [testenv:docs] -commands= - python setup.py build_sphinx +deps = -r{toxinidir}/doc/requirements.txt +commands = + sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] -commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html +deps = -r{toxinidir}/doc/requirements.txt +commands = + sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [flake8] ignore = F403,F812,F821