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
#2021: changed autosummary to only consider elements of __all__, if present #9455
Conversation
…__ members, if __all__ exists
Thank you, that would simplify my duties a lot! |
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.
Looks good. But we need to add an option to keep __all__
list ignored.
Is this really necessary? I would be surprised if there is a single project that really wants this option. {% block members %}
{% if members %}
.. rubric:: {{ _('Module Members') }}
.. autosummary::
:toctree: {{ objname }}
{% for item in members %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %} Then all of the otherwise hidden module members get added as well: Who would want to see all this nonsense for every module? |
I'd agree to that no one wants to have these kind of implementation details in the members list. However I think that since this is a change of behavior, people should be given the chance to still use the old behavior. Therefore we need a switch. |
I can't say there are no projects that depend on the old behavior in the world. I agree they're very few. But this change will bring a breaking change for them. So I can't accept this change without an option. |
@randolf-scholz Hi! I need this feature and don't want it to miss the next release. I'd be happy to extend this PR to take a configuration option, but don't want to step on your toes! Please let me know if you're committed to finishing things up here, or if you don't mind me taking over. |
@Yoshanuikabundi Hey, sorry I am super busy atm and don't really have time look into it currently. Personally, for several other reasons I also switched my projects to https://github.com/readthedocs/sphinx-autoapi. |
@randolf-scholz No worries, thanks for the update! |
@Yoshanuikabundi I sent a PR to @randolf-scholz including the config interface already. I think it would serve as a base to make further progress. The only thing missing are proper tests for the new interface. @randolf-scholz when you are so busy, would you like to delegate this to our hands? I dunno if or how we would be able to directly push to your forked branch, but this would simplify things a lot. Thank you! |
sorry i'm out of time right now, but will do next week. The code looks good so far. |
Now I merged #9831 as a successor of this PR. Thank you for all your contributions :-) |
Addresses #2021
Feature or Bugfix
Not sure if it should be considered a feature enhancement or bug fix.
Purpose
__all__
files when determining members, this PR changes the behaviour to always respect the__all__
list, if it exists.Detail
Changed 2 iterators from
to
using the
sphinx.util.inspect.getall
function, which returns__all__
, if it exists, elseNone
.Relates