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

Semi-automatically populate __all__ in __init__.py files #337

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

vpratz
Copy link
Collaborator

@vpratz vpratz commented Feb 24, 2025

This PR implements one possible solution to the problem highlighted in #290. By specifying __all__ in the relevant files, it makes explicit which modules and functions should be documented, so that only desired functions and modules are included. This also allows setting autosummary_imported_members = False, which greatly speeds up building the documentation.

It requires manual action when:

  • a new public submodule is added: has to be added to the include_submodules list in the parent module
  • a new __init__.py is added: must add the following boilerplate at the end of the file (number of dots before utils depends on the path):
from ..utils._docs import _add_imports_to_all

_add_imports_to_all(include_modules=[])

Please give feedback on the underlying mechanism. Is this an option we would be happy with, or should we rather try something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant