Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autosummary: Extend
__all__
members to template rendering (#10811)
When ``False``, the ``autosummary_ignore_module_all`` option adds members to the module's members entry that will be used for autodoc, but otherwise ignores it. As such, if a class is available in the ``__all__``, it won't be generated. This commit aims to extend the ``__all__`` handling not only to members, but also to corresponding attribute types (function, classes, exceptions, modules) The ``imported_members`` option is set to ``True`` if the object has an ``__all__`` member and ``autosummary_ignore_module_all`` is ``False``
- Loading branch information
1 parent
52a099b
commit 9299003
Showing
9 changed files
with
147 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/roots/test-ext-autosummary-module_all/autosummary_dummy_package_all/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from .autosummary_dummy_module import Bar, PublicBar, foo, public_foo | ||
|
||
|
||
def baz(): | ||
"""Baz function""" | ||
pass | ||
|
||
|
||
def public_baz(): | ||
"""Public Baz function""" | ||
|
||
|
||
__all__ = ["PublicBar", "public_foo", "public_baz", "extra_dummy_module"] |
20 changes: 20 additions & 0 deletions
20
...test-ext-autosummary-module_all/autosummary_dummy_package_all/autosummary_dummy_module.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Bar: | ||
"""Bar class""" | ||
|
||
pass | ||
|
||
|
||
class PublicBar: | ||
"""Public Bar class""" | ||
|
||
pass | ||
|
||
|
||
def foo(): | ||
"""Foo function""" | ||
pass | ||
|
||
|
||
def public_foo(): | ||
"""Public Foo function""" | ||
pass |
20 changes: 20 additions & 0 deletions
20
...roots/test-ext-autosummary-module_all/autosummary_dummy_package_all/extra_dummy_module.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Bar: | ||
"""Bar class""" | ||
|
||
pass | ||
|
||
|
||
class PublicBar: | ||
"""Public Bar class""" | ||
|
||
pass | ||
|
||
|
||
def foo(): | ||
"""Foo function""" | ||
pass | ||
|
||
|
||
def public_foo(): | ||
"""Public Foo function""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath('.')) | ||
|
||
extensions = ['sphinx.ext.autosummary'] | ||
autosummary_generate = True | ||
autosummary_ignore_module_all = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test-ext-autosummary-module_all | ||
=============================== | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:recursive: | ||
|
||
autosummary_dummy_package_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters