Skip to content

Commit

Permalink
Corrections from review by tk0miya
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoshanuikabundi committed Nov 15, 2021
1 parent f3d0955 commit 79089b5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
5 changes: 4 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ Features added

* #9815: html theme: Wrap sidebar components in div to allow customizing their
layout via CSS
* #9831: Autosummary now documents only the members specified in a module's ``__all__`` attribute if :confval:`autosummary_ignore___all__` is set to ``False``. The default behaviour is unchanged.
* #9831: Autosummary now documents only the members specified in a module's
``__all__`` attribute if :confval:`autosummary_ignore___all__` is set to
``False``. The default behaviour is unchanged. Autogen also now supports
this behavior with the ``--respect-module-all`` switch.

Bugs fixed
----------
Expand Down
4 changes: 4 additions & 0 deletions doc/man/sphinx-autogen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Options

Document imported members.

.. option:: -a, --respect-module-all

Document exactly the members in a module's ``__all__`` attribute.

Example
-------

Expand Down
14 changes: 7 additions & 7 deletions doc/usage/extensions/autosummary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ also use these config values:

.. versionadded:: 2.1

.. versionchanged:: 4.3
.. versionchanged:: 4.4

If ``autosummary_ignore___all__`` is ``False``, this configuration value
is ignored for members listed in ``__all__``.
If ``autosummary_ignore_module_all`` is ``False``, this configuration
value is ignored for members listed in ``__all__``.

.. confval:: autosummary_ignore___all__
.. confval:: autosummary_ignore_module_all

If ``False`` and a module has the ``__all__`` attribute set, autosummary
documents every member listed in ``__all__`` and no others. Default is
Expand All @@ -215,10 +215,10 @@ also use these config values:
Note that if an imported member is listed in ``__all__``, it will be
documented regardless of the value of ``autosummary_imported_members``. To
match the behaviour of ``from module import *``, set
``autosummary_ignore___all__`` to False and ``autosummary_imported_members``
to True.
``autosummary_ignore_module_all`` to False and
``autosummary_imported_members`` to True.

.. versionadded:: 4.3
.. versionadded:: 4.4

.. confval:: autosummary_filename_map

Expand Down
2 changes: 1 addition & 1 deletion sphinx/ext/autosummary/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def get_parser() -> argparse.ArgumentParser:
dest='imported_members', default=False,
help=__('document imported members (default: '
'%(default)s)'))
parser.add_argument('-a', '--respect-__all__', action='store_false',
parser.add_argument('-a', '--respect-module-all', action='store_false',
dest='ignore___all__', default=True,
help=__('document exactly the members in module __all__ attribute. '
'(default: %(default)s)'))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ext_autosummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def test_autosummary_generate(app, status, warning):
assert doctree[3][0][0][2][5].astext() == 'autosummary_dummy_module.qux\n\na module-level attribute'

module = (app.srcdir / 'generated' / 'autosummary_dummy_module.rst').read_text()
print(module)

assert (' .. autosummary::\n'
' \n'
' Foo\n'
Expand Down

0 comments on commit 79089b5

Please sign in to comment.