Clean up API documentation

Use explicit files instead of auto-generating them.

Fail the build on a warning.

Tweak titles and other headings.

Add instructions for using lockutils-wrapper.

Change-Id: Ie92ce14b33180d35d84bbd0998e61b659487481d
This commit is contained in:
Doug Hellmann 2014-12-10 08:31:04 -05:00
parent 5de5c42b1f
commit d59543df4a
10 changed files with 69 additions and 35 deletions

1
.gitignore vendored
View File

@ -41,7 +41,6 @@ output/*/index.html
# Sphinx # Sphinx
doc/build doc/build
doc/source/api
# pbr generates these # pbr generates these
AUTHORS AUTHORS

View File

@ -0,0 +1,8 @@
===========================================
:mod:`oslo_concurrency.fixture.lockutils`
===========================================
.. automodule:: oslo_concurrency.fixture.lockutils
:members:
:undoc-members:
:show-inheritance:

7
doc/source/api/index.rst Normal file
View File

@ -0,0 +1,7 @@
.. toctree::
:maxdepth: 1
fixture.lockutils
lockutils
opts
processutils

View File

@ -0,0 +1,8 @@
===================================
:mod:`oslo_concurrency.lockutils`
===================================
.. automodule:: oslo_concurrency.lockutils
:members:
:undoc-members:
:show-inheritance:

8
doc/source/api/opts.rst Normal file
View File

@ -0,0 +1,8 @@
==============================
:mod:`oslo_concurrency.opts`
==============================
.. automodule:: oslo_concurrency.opts
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,8 @@
======================================
:mod:`oslo_concurrency.processutils`
======================================
.. automodule:: oslo_concurrency.processutils
:members:
:undoc-members:
:show-inheritance:

View File

@ -34,23 +34,7 @@ extensions = [
# A list of glob-style patterns that should be excluded when looking for source # A list of glob-style patterns that should be excluded when looking for source
# files. # files.
exclude_patterns = [ exclude_patterns = []
'api/tests.*', # avoid of docs generation from tests
'api/oslo.concurrency.*', # skip deprecated import from namespace package
'api/oslo_concurrency.openstack.common.*', # skip common modules
'api/oslo_concurrency._*', # skip private modules
]
# Prune the excluded patterns from the autoindex
PATH = 'api/autoindex.rst'
if os.path.isfile(PATH) and os.access(PATH, os.R_OK):
for line in fileinput.input(PATH, inplace=True):
found = False
for pattern in exclude_patterns:
if fnmatch.fnmatch(line, '*' + pattern[4:]):
found = True
if not found:
print line,
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = '.rst'

View File

@ -3,13 +3,12 @@
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to oslo.concurrency's documentation! ==================
=============================================================== oslo.concurrency
==================
Contents:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 1
readme readme
installation installation
@ -17,13 +16,13 @@ Contents:
contributing contributing
history history
Code Documentation API Documentation
================== =================
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
api/autoindex api/index
Indices and tables Indices and tables
================== ==================

View File

@ -1,7 +1,23 @@
======== =======
Usage Usage
======== =======
To use oslo.concurrency in a project:: To use oslo.concurrency in a project, import the relevant module. For
example::
from oslo import concurrency from oslo_concurrency import lockutils
.. seealso::
* :doc:`API Documentation <api/index>`
Command Line Wrapper
====================
``oslo.concurrency`` includes a command line tool for use in test jobs
that need the environment variable :envvar:`OSLO_LOCK_PATH` set. To
use it, prefix the command to be run with
:command:`lockutils-wrapper`. For example::
$ lockutils-wrapper env | grep OSLO_LOCK_PATH
OSLO_LOCK_PATH=/tmp/tmpbFHK45

View File

@ -58,10 +58,7 @@ mapping_file = babel.cfg
output_file = oslo.concurrency/locale/oslo.concurrency.pot output_file = oslo.concurrency/locale/oslo.concurrency.pot
[pbr] [pbr]
# NOTE(dims): uncomment ``warnerrors`` line, when warnerrors = True
# want to treat sphinx warnings as errors
# warnerrors = True
autodoc_index_modules = True
[wheel] [wheel]
universal = 1 universal = 1