Open francois-rozet opened 3 months ago
With __all__ = [] in a module, autosummary takes everything as a member instead of nothing, even with autosummary_ignore_module_all = False. In addition, weird members like __builtins__, __file__ and __package__ are showed as members.
__all__ = []
autosummary
autosummary_ignore_module_all = False
__builtins__
__file__
__package__
"""Dummy module""" __all__ = [] def component(): """Dummy component""" pass
I provide a minimal reproducing example in https://github.com/francois-rozet/sphinx-bug
git clone https://github.com/francois-rozet/sphinx-bug cd sphinx-bug pip install -e . pip install sphinx sphinx-build . html open html/api/dummy.html
Platform: linux; (Linux-6.5.0-0.deb12.4-amd64-x86_64-with-glibc2.38) Python version: 3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:49:32) [GCC 12.3.0]) Python implementation: CPython Sphinx version: 7.3.7 Docutils version: 0.19 Jinja2 version: 3.1.2 Pygments version: 2.17.2
extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', ]
No response
Note that if dummy/__init__.py is empty
dummy/__init__.py
"""Dummy module""" # __all__ = [] # def component(): # """Dummy component""" # pass
the weird members (__builtins__, __cached__, ...) still appear.
__cached__
Describe the bug
With
__all__ = []
in a module,autosummary
takes everything as a member instead of nothing, even withautosummary_ignore_module_all = False
. In addition, weird members like__builtins__
,__file__
and__package__
are showed as members.How to Reproduce
I provide a minimal reproducing example in https://github.com/francois-rozet/sphinx-bug
Environment Information
Sphinx extensions
Additional context
No response