summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2019-04-02 14:39:50 +0100
committerStephen Finucane <stephenfin@redhat.com>2019-05-21 08:50:29 +0000
commit05ddd9fc9e814b8a949ee65b512b35f2432ccec6 (patch)
treeb8d28976047d2ca4c6aa988f1e287244d96e962d
parentb9c51e295b81cedbc747e662628bc69d1f60e6db (diff)
downloadoslo-db-5.0.0.tar.gz
docs: Use sphinxcontrib.apidoc for building API docs5.0.0
Gets us away from the old pbr functionality. Some cleanup of tox.ini is included along the way. Change-Id: Ia228f8ee49f31f88fa2a66f2aad3a3921c41a785
-rw-r--r--doc/requirements.txt7
-rwxr-xr-xdoc/source/conf.py47
-rw-r--r--doc/source/reference/index.rst2
-rw-r--r--setup.cfg19
-rw-r--r--tox.ini54
5 files changed, 40 insertions, 89 deletions
diff --git a/doc/requirements.txt b/doc/requirements.txt
index 3cf8db9..024debe 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -6,9 +6,4 @@ 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
doc8>=0.6.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
-
-# These modules are needed when generating document
-fixtures>=3.0.0 # Apache-2.0/BSD
-testresources>=2.0.0 # Apache-2.0/BSD
-testscenarios>=0.4 # Apache-2.0/BSD
-oslotest>=3.2.0 # Apache-2.0
+sphinxcontrib-apidoc>=0.2.0 # BSD
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 576e270..afa698b 100755
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -11,17 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import os
-import sys
-
-sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
# 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',
- #'sphinx.ext.intersphinx',
+ 'sphinxcontrib.apidoc',
'oslo_config.sphinxext',
'openstackdocstheme',
'stevedore.sphinxext'
@@ -31,23 +27,6 @@ repository_name = 'openstack/oslo.db'
bug_project = 'oslo.db'
bug_tag = ''
-# Must set this variable to include year, month, day, hours, and minutes.
-html_last_updated_fmt = '%Y-%m-%d %H:%M'
-
-# autodoc generation is a bit aggressive and a nuisance when doing heavy
-# text edit cycles.
-# execute "export SPHINX_DEBUG=1" in your terminal to disable
-
-# A list of glob-style patterns that should be excluded when looking for source
-# files.
-exclude_patterns = [
- 'api/setup.rst', # workaround for https://launchpad.net/bugs/1260495
- 'api/tests.*', # avoid of docs generation from tests
-]
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
# The master toctree document.
master_doc = 'index'
@@ -68,26 +47,18 @@ pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['oslo_db.']
-# -- Options for HTML output --------------------------------------------------
+
+# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
-# html_theme_path = ["."]
html_theme = 'openstackdocs'
-# html_static_path = ['static']
-# Output file base name for HTML help builder.
-htmlhelp_basename = '%sdoc' % project
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass
-# [howto/manual]).
-latex_documents = [
- ('index',
- '%s.tex' % project,
- u'%s Documentation' % project,
- u'OpenStack Foundation', 'manual'),
-]
+# -- sphinxcontrib.apidoc configuration --------------------------------------
-# Example configuration for intersphinx: refer to the Python standard library.
-#intersphinx_mapping = {'http://docs.python.org/': None}
+apidoc_module_dir = '../../oslo_db'
+apidoc_output_dir = 'reference/api'
+apidoc_excluded_paths = [
+ 'tests',
+]
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/setup.cfg b/setup.cfg
index 532860f..68af244 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -21,10 +21,10 @@ classifier =
[extras]
# So e.g. nova can test-depend on oslo.db[mysql]
mysql =
- PyMySQL>=0.7.6 # MIT License
+ PyMySQL>=0.7.6 # MIT License
# or oslo.db[postgresql]
postgresql =
- psycopg2>=2.7.0 # LGPL/ZPL
+ psycopg2>=2.7.0 # LGPL/ZPL
[files]
packages =
@@ -42,15 +42,6 @@ oslo.db.migration =
[bdist_wheel]
universal = 1
-[build_sphinx]
-source-dir = doc/source
-build-dir = doc/build
-all_files = 1
-warning-is-error = 1
-
-[upload_sphinx]
-upload-dir = doc/build/html
-
[compile_catalog]
directory = oslo_db/locale
domain = oslo_db
@@ -64,9 +55,3 @@ input_file = oslo_db/locale/oslo_db.pot
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = oslo_db/locale/oslo_db.pot
-
-[pbr]
-autodoc_index_modules = True
-api_doc_dir = reference/api
-autodoc_exclude_modules =
- oslo_db.tests.*
diff --git a/tox.ini b/tox.ini
index bb733d5..f4054e5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,34 +1,29 @@
[tox]
minversion = 2.0
-envlist = py35,py27,pep8
+envlist = py27,py35,pep8
[testenv]
-install_command = pip install {opts} {packages}
-whitelist_externals = bash
- env
+whitelist_externals =
+ env
+passenv =
+ OS_TEST_DBAPI_ADMIN_CONNECTION
setenv =
- VIRTUAL_ENV={envdir}
- BASECOMMAND=stestr run
- BRANCH_NAME=master
- CLIENT_NAME=oslo.db
-
- {postgresql,all}: PIFPAF_POSTGRESQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run postgresql --
- {mysql,all}: PIFPAF_MYSQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run mysql --
- {mysql,postgresql,all}: BASECOMMAND={toxinidir}/tools/run-pifpaf-tests.sh
+ BASECOMMAND=stestr run
+ {postgresql,all}: PIFPAF_POSTGRESQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run postgresql --
+ {mysql,all}: PIFPAF_MYSQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run mysql --
+ {mysql,postgresql,all}: BASECOMMAND={toxinidir}/tools/run-pifpaf-tests.sh
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
+ -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
commands =
{env:PIFPAF_MYSQL:} {env:PIFPAF_POSTGRESQL:} {env:BASECOMMAND:} {posargs}
-passenv = OS_TEST_DBAPI_ADMIN_CONNECTION
-
[testenv:py27]
basepython = python2.7
commands =
- env TEST_EVENTLET=0 stestr run {posargs}
- env TEST_EVENTLET=1 stestr run {posargs}
+ env TEST_EVENTLET=0 stestr run {posargs}
+ env TEST_EVENTLET=1 stestr run {posargs}
[testenv:pep8]
basepython = python3
@@ -44,19 +39,24 @@ commands = {posargs}
[testenv:cover]
basepython = python3
setenv =
- PYTHON=coverage run --source oslo_db --parallel-mode
+ PYTHON=coverage run --source oslo_db --parallel-mode
commands =
- stestr run {posargs}
- coverage combine
- coverage html -d cover
- coverage xml -o cover/coverage.xml
+ stestr run {posargs}
+ coverage combine
+ coverage html -d cover
+ coverage xml -o cover/coverage.xml
[testenv:docs]
basepython = python3
-deps = -r{toxinidir}/doc/requirements.txt
+whitelist_externals =
+ rm
+deps =
+ {[testenv]deps}
+ -r{toxinidir}/doc/requirements.txt
commands =
- doc8 -e .rst CONTRIBUTING.rst HACKING.rst README.rst doc/source
- sphinx-build -b html doc/source doc/build/html
+ rm -rf doc/build doc/source/reference/api
+ doc8 -e .rst CONTRIBUTING.rst HACKING.rst README.rst doc/source
+ sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes]
basepython = python3