Skip to content

Commit 8e45229

Browse files
Fixed missed ignore___all__ -> ignore_module_all
1 parent 79089b5 commit 8e45229

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Features added
1616
* #9815: html theme: Wrap sidebar components in div to allow customizing their
1717
layout via CSS
1818
* #9831: Autosummary now documents only the members specified in a module's
19-
``__all__`` attribute if :confval:`autosummary_ignore___all__` is set to
19+
``__all__`` attribute if :confval:`autosummary_ignore_module_all` is set to
2020
``False``. The default behaviour is unchanged. Autogen also now supports
2121
this behavior with the ``--respect-module-all`` switch.
2222

sphinx/ext/autosummary/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,6 @@ def setup(app: Sphinx) -> Dict[str, Any]:
826826
app.add_config_value('autosummary_mock_imports',
827827
lambda config: config.autodoc_mock_imports, 'env')
828828
app.add_config_value('autosummary_imported_members', [], False, [bool])
829-
app.add_config_value('autosummary_ignore___all__', True, 'env', bool)
829+
app.add_config_value('autosummary_ignore_module_all', True, 'env', bool)
830830

831831
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}

sphinx/ext/autosummary/generate.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, translator: NullTranslations) -> None:
6868

6969
self.config.add('autosummary_context', {}, True, None)
7070
self.config.add('autosummary_filename_map', {}, True, None)
71-
self.config.add('autosummary_ignore___all__', True, 'env', bool)
71+
self.config.add('autosummary_ignore_module_all', True, 'env', bool)
7272
self.config.init_values()
7373

7474
def emit_firstresult(self, *args: Any) -> None:
@@ -219,7 +219,7 @@ def scan(self, imported_members: bool) -> List[str]:
219219
elif imported is False:
220220
# list not-imported members
221221
members.append(name)
222-
elif '__all__' in dir(self.object) and not self.app.config.autosummary_ignore___all__:
222+
elif '__all__' in dir(self.object) and not self.app.config.autosummary_ignore_module_all:
223223
# list members that have __all__ set
224224
members.append(name)
225225

@@ -228,9 +228,9 @@ def scan(self, imported_members: bool) -> List[str]:
228228
def members_of(conf: Config, obj: Any) -> Sequence[str]:
229229
"""Get the members of ``obj``, possibly ignoring the ``__all__`` module attribute
230230
231-
Follows the ``conf.autosummary_ignore___all__`` setting."""
231+
Follows the ``conf.autosummary_ignore_module_all`` setting."""
232232

233-
if conf.autosummary_ignore___all__:
233+
if conf.autosummary_ignore_module_all:
234234
return dir(obj)
235235
else:
236236
return getall(obj) or dir(obj)
@@ -645,8 +645,8 @@ def get_parser() -> argparse.ArgumentParser:
645645
dest='imported_members', default=False,
646646
help=__('document imported members (default: '
647647
'%(default)s)'))
648-
parser.add_argument('-a', '--respect-module-all', action='store_false',
649-
dest='ignore___all__', default=True,
648+
parser.add_argument('-a', '--respect-module-all', action='store_true',
649+
dest='respect_module_all', default=False,
650650
help=__('document exactly the members in module __all__ attribute. '
651651
'(default: %(default)s)'))
652652

@@ -665,7 +665,7 @@ def main(argv: List[str] = sys.argv[1:]) -> None:
665665

666666
if args.templates:
667667
app.config.templates_path.append(path.abspath(args.templates))
668-
app.config.autosummary_ignore___all__ = args.ignore___all__
668+
app.config.autosummary_ignore_module_all = not args.respect_module_all
669669

670670
generate_autosummary_docs(args.source_file, args.output_dir,
671671
'.' + args.suffix,

tests/test_ext_autosummary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_autosummary_generate_content_for_module(app):
238238
def test_autosummary_generate_content_for_module___all__(app):
239239
import autosummary_dummy_module
240240
template = Mock()
241-
app.config.autosummary_ignore___all__ = False
241+
app.config.autosummary_ignore_module_all = False
242242

243243
generate_autosummary_content('autosummary_dummy_module', autosummary_dummy_module, None,
244244
template, None, False, app, False, {})

0 commit comments

Comments
 (0)