diff --git a/CHANGES b/CHANGES index a1b2479a3c..44faffea9e 100644 --- a/CHANGES +++ b/CHANGES @@ -24,6 +24,8 @@ Bugs fixed ---------- * #10133: autodoc: Crashed when mocked module is used for type annotation +* #10146: autodoc: :confval:`autodoc_default_options` does not support + ``no-value`` option * #10122: sphinx-build: make.bat does not check the installation of sphinx-build command before showing help diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst index dfb08e688e..3849f4713a 100644 --- a/doc/usage/extensions/autodoc.rst +++ b/doc/usage/extensions/autodoc.rst @@ -528,7 +528,8 @@ There are also config values that you can set: The supported options are ``'members'``, ``'member-order'``, ``'undoc-members'``, ``'private-members'``, ``'special-members'``, ``'inherited-members'``, ``'show-inheritance'``, ``'ignore-module-all'``, - ``'imported-members'``, ``'exclude-members'`` and ``'class-doc-from'``. + ``'imported-members'``, ``'exclude-members'``, ``'class-doc-from'`` and + ``'no-value'``. .. versionadded:: 1.8 @@ -541,6 +542,9 @@ There are also config values that you can set: .. versionchanged:: 4.1 Added ``'class-doc-from'``. + .. versionchanged:: 4.5 + Added ``'class-doc-from'``. + .. confval:: autodoc_docstring_signature Functions imported from C modules cannot be introspected, and therefore the diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index 8a86f05b1a..0e88d914c4 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1001,7 +1001,8 @@ class ModuleDocumenter(Documenter): 'platform': identity, 'deprecated': bool_option, 'member-order': member_order_option, 'exclude-members': exclude_members_option, 'private-members': members_option, 'special-members': members_option, - 'imported-members': bool_option, 'ignore-module-all': bool_option + 'imported-members': bool_option, 'ignore-module-all': bool_option, + 'no-value': bool_option, } def __init__(self, *args: Any) -> None: diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index 8b8048f8a9..0c040e1ef3 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -30,7 +30,7 @@ AUTODOC_DEFAULT_OPTIONS = ['members', 'undoc-members', 'inherited-members', 'show-inheritance', 'private-members', 'special-members', 'ignore-module-all', 'exclude-members', 'member-order', - 'imported-members', 'class-doc-from'] + 'imported-members', 'class-doc-from', 'no-value'] AUTODOC_EXTENDABLE_OPTIONS = ['members', 'private-members', 'special-members', 'exclude-members']