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/19changes/57/492557/1
parent
ad966ccc46
commit
fb95d09b36
|
@ -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',
|
||||
|
|
|
@ -11,6 +11,7 @@ python-subunit
|
|||
testrepository>=0.0.17
|
||||
testtools>=0.9.32
|
||||
sphinxcontrib-programoutput
|
||||
sphinx-autodoc-typehints
|
||||
mock
|
||||
PyMySQL
|
||||
mypy
|
||||
|
|
Loading…
Reference in New Issue