Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
}

# Other extension configs
autodoc_use_legacy_class_based = True
autodoc_default_options = {
"members": True,
"special-members": True,
Expand Down
6 changes: 5 additions & 1 deletion invocations/autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
<https://github.com/sphinx-doc/sphinx/issues/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``.
Expand All @@ -47,6 +50,7 @@

# For sane mock patching. Meh.
from sphinx.ext import autodoc
from sphinx.util.inspect import stringify_signature


class TaskDocumenter(
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/autodoc/_support/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

master_doc = "index"
extensions = ["invocations.autodoc"]
autodoc_use_legacy_class_based = True
autodoc_default_options = dict(members=True)