- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow autosummary to respect __all__ #9831
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM basically. Let's go forward!
I believe this is now ready to merge. From everything I've read, I don't think submodules are supposed to go into |
2204c76
to
8e45229
Compare
Fixed those, grepped everything for any other option names I missed, and rebased on current 4.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits :-)
It seems flake8 and mypy warns something. Could you check them please? |
Fixed. What are your thoughts on the submodules thing?
Having thought about it I think I do want this behaviour for my projects, but I can't find clear docs on how modules should be included in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I agree it would be better to add a way to control what submodules are documented (or undocumented) on the recursive build. But I'm not sure using |
As I commented above, controlling submodules is another topic. So I'd like to merge this. What do you think? |
Cool! I'll open an issue to discuss design of the submodules thing when I get a chance. I agree that this is ready to merge :) |
Okay, merging now! |
Thank you for your great work! |
Python's
__all__
attribute defines the public API of a module or package. Autosummary should support this.Feature or Bugfix
Purpose
Python modules and packages can supply a list of names in the
__all__
attribute to declare the public interface. If this is present, Autosummary should use it to determine which objects to document.Detail
autosummary_ignore___all__
configuration value,True
by default. This anticipates a future breaking change where this will be set toFalse
as discussed in #2021: changed autosummary to only consider elements of __all__, if present #9455autosummary_ignore___all__
isFalse
, autosummary will use the__all__
attribute to discover the module's membersautosummary_ignore___all__
isFalse
but a module does not have the__all__
attribute, the previous behaviour is kept-a
/--respect-__all__
command line switch has been added to autogen to support this behaviour on the CLI__all__
. This matches the behaviour ofpydoc
, but I think submodules may or may not be a part of the public API and should be controlled by the same mechanism. I haven't had time to track this down yet but should be able to do so tomorrow. Thoughts?Relates