diff --git a/doc/source/conf.py b/doc/source/conf.py index ad9161d..4f69dc1 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -14,6 +14,8 @@ import os import sys +import fileinput +import fnmatch sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- @@ -30,6 +32,23 @@ extensions = [ # 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/tests.*', # avoid of docs generation from tests + 'api/oslo.concurrency.openstack.common.*', # skip common modules + 'api/oslo.concurrency._*', # skip private modules +] + +# Prune the excluded patterns from the autoindex +for line in fileinput.input('api/autoindex.rst', 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. source_suffix = '.rst' diff --git a/doc/source/index.rst b/doc/source/index.rst index 8ed8add..dc4f6f2 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -16,6 +16,14 @@ Contents: usage contributing +Code Documentation +================== + +.. toctree:: + :maxdepth: 1 + + api/autoindex + Indices and tables ================== diff --git a/setup.cfg b/setup.cfg index af03413..0831f27 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,4 +46,10 @@ input_file = oslo.concurrency/locale/oslo.concurrency.pot [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg -output_file = oslo.concurrency/locale/oslo.concurrency.pot \ No newline at end of file +output_file = oslo.concurrency/locale/oslo.concurrency.pot + +[pbr] +# NOTE(dims): uncomment ``warnerrors`` line, when +# want to treat sphinx warnings as errors +# warnerrors = True +autodoc_index_modules = True diff --git a/test-requirements.txt b/test-requirements.txt index 95ce56d..2cce7cf 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,5 +2,5 @@ hacking>=0.9.1,<0.10 oslotest # These are needed for docs generation -oslosphinx +oslosphinx>=2.2.0.0a2 sphinx>=1.1.2,!=1.2.0,<1.3