Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Non-exported submodules included in Modules table following "Auto-summary of members" #203

Closed
ringohoffman opened this issue Nov 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ringohoffman
Copy link

ringohoffman commented Nov 11, 2024

Description of the bug

Following 7f9757d, other submodules of the package not exported via __all__ are being included in a Modules: section.

e.g. for:

foo/module2.py:

from foo import module1

__all__ = [
    "Bar",
]

class Bar:
    """Bars the bazes."""

module1 is getting included into a Modules table even though it is not exported.

To Reproduce

https://github.com/ringohoffman/mkdocstrings-python-minimum-reproducible-example/tree/main

git clone https://github.com/ringohoffman/mkdocstrings-python-minimum-reproducible-example
cd mkdocstrings-python-minimum-reproducible-example
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
mkdocs build
mkdocs serve

Then open the doc page for module2.

Full traceback

Screenshot 2024-11-11 at 15 13 26

Expected behavior

I only expect the modules to be included in the Modules section if they are exported via __all__.

Environment information

python -m mkdocstrings_handlers.python.debug  # | xclip -selection clipboard
- __System__: Linux-5.15.0-117-generic-x86_64-with-glibc2.31
- __Python__: cpython 3.10.15 (/home/matthew/.conda/envs/mkdocstrings/bin/python)
- __Environment variables__:
- __Installed packages__:
  - `mkdocs` v1.6.1
  - `mkdocstrings` v0.26.2
  - `mkdocstrings-python` v1.12.2
  - `griffe` v1.5.1
@ringohoffman ringohoffman added the unconfirmed This bug was not reproduced yet label Nov 11, 2024
@ringohoffman ringohoffman changed the title bug: bug: Non-exported submodules included in Modules table following "Auto-summary of members" Nov 11, 2024
@pawamoy
Copy link
Member

pawamoy commented Nov 12, 2024

Thanks for the report @ringohoffman, looks like something that can be fixed/improved indeed.

@pawamoy
Copy link
Member

pawamoy commented Nov 26, 2024

Marking this as a bug. Only public objects should be added to auto-summaries.

@pawamoy pawamoy added bug Something isn't working and removed unconfirmed This bug was not reproduced yet labels Nov 26, 2024
pawamoy added a commit that referenced this issue Dec 3, 2024
@pawamoy pawamoy closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants