Add sphinx-autodoc-typehits sphinx extension

Since we have some python3 typehints in the code now, there is no need
to duplicate that information in sphinx docstrings.
sphinx-autodoc-typehints reads type annotations and updates :type:
information for :param: and :rtype: for :returns:. The results are the
same as if :param: had been given a type or a :type: directive, so this
is essentially just in service of using the same information for both
type hints/static analysis and for documentation.

There is a bug in the released version in that it does not consider
someone setting a default domain explicitly such as we do in zuul. A
pull request has been submitted that fixes the issue

Change-Id: I900a58eb6503cfee3cdff83e6cc376b5e2da3d44
Depends-On: https://github.com/agronholm/sphinx-autodoc-typehints/pull/19
This commit is contained in:
Monty Taylor 2017-08-10 09:38:03 -05:00
parent ad966ccc46
commit fb95d09b36
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 2 additions and 0 deletions

View File

@ -27,6 +27,7 @@ sys.path.insert(0, os.path.abspath('../..'))
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx_autodoc_typehints',
'sphinx.ext.graphviz',
'sphinxcontrib.blockdiag',
'sphinxcontrib.programoutput',

View File

@ -11,6 +11,7 @@ python-subunit
testrepository>=0.0.17
testtools>=0.9.32
sphinxcontrib-programoutput
sphinx-autodoc-typehints
mock
PyMySQL
mypy