Enforce our configuration defaults for autodoc.
Review Request #12515 — Created Aug. 8, 2022 and submitted — Latest diff uploaded
This listens to when configuration is being initialized and sets our own
defaults, helping to enforce a consistent style across our documentation
and to reduce the work needed to set things up.The defaults turn off the Numpy and Google docstring parsers, set
standard autodoc class ordering and flags, and ensure our own type
hinting is used.It sets some autodoc defaults that we end up setting in each codebase,
and normalizesautodoc_excludes
.If a codebase needs to, it can opt out of these defaults by setting
use_beanbag_autodoc_defaults=False
.It registers
unicode
as a type that maps tostr
when building
against a Python 3 intersphinx or against theunicode
function when
building against a Python 2 intersphinx.And finally, it returns version information for the extension so that
any new versions will cause a doc rebuild.
Unit tests pass.
Tested these with a couple codebases, and the default options removed
from the codebase'sconf.py
. Didn't see any regressions.