diff --git a/docs/conf.py b/docs/conf.py index b0199d9..1962dea 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,6 +41,7 @@ } # Other extension configs +autodoc_use_legacy_class_based = True autodoc_default_options = { "members": True, "special-members": True, diff --git a/invocations/autodoc.py b/invocations/autodoc.py index fbff267..30e72e0 100644 --- a/invocations/autodoc.py +++ b/invocations/autodoc.py @@ -26,6 +26,9 @@ - As noted above, this only works for modules that are importable, like any other Sphinx autodoc use case. + - For now, add ``autodoc_use_legacy_class_based = True`` to your + ``conf.py`` (see `sphinx-doc/sphinx#14089 + `__). - Unless you want to opt-in which module members get documented, use ``:members:`` or add ``"members": True`` to your ``conf.py``'s ``autodoc_default_options``. @@ -47,6 +50,7 @@ # For sane mock patching. Meh. from sphinx.ext import autodoc +from sphinx.util.inspect import stringify_signature class TaskDocumenter( @@ -68,7 +72,7 @@ def format_args(self): # after which point "call tasks as raw functions" may be less common. # TODO: also, it may become moot-ish if we turn this all into emission # of custom domain objects and/or make the CLI arguments the focus - return autodoc.stringify_signature(inspect.signature(function)) + return stringify_signature(inspect.signature(function)) def document_members(self, all_members=False): # Neuter this so superclass bits don't introspect & spit out autodoc diff --git a/tests/autodoc/_support/conf.py b/tests/autodoc/_support/conf.py index a33252e..5e30750 100644 --- a/tests/autodoc/_support/conf.py +++ b/tests/autodoc/_support/conf.py @@ -7,4 +7,5 @@ master_doc = "index" extensions = ["invocations.autodoc"] +autodoc_use_legacy_class_based = True autodoc_default_options = dict(members=True)