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
Docstring metadata ignored for attributes #8180
Labels
Milestone
Comments
akruis
pushed a commit
to scVENUS/sphinx
that referenced
this issue
May 11, 2022
akruis
pushed a commit
to scVENUS/sphinx
that referenced
this issue
May 11, 2022
akruis
pushed a commit
to scVENUS/sphinx
that referenced
this issue
May 13, 2022
The test checks, if ":meta private:" and ":meta public:" have an effect in attributes of a class. Currently the new test cases fail. The fix is in the next commit.
akruis
pushed a commit
to scVENUS/sphinx
that referenced
this issue
May 13, 2022
Change ext.autodoc.importer.get_class_members to set ObjectMember.docstring the docstring found by the source code analyzer.
akruis
pushed a commit
to scVENUS/sphinx
that referenced
this issue
May 13, 2022
tk0miya
pushed a commit
to tk0miya/sphinx
that referenced
this issue
May 22, 2022
The test checks, if ":meta private:" and ":meta public:" have an effect in attributes of a class. Currently the new test cases fail. The fix is in the next commit.
tk0miya
pushed a commit
to tk0miya/sphinx
that referenced
this issue
May 22, 2022
Change ext.autodoc.importer.get_class_members to set ObjectMember.docstring the docstring found by the source code analyzer.
tk0miya
pushed a commit
to tk0miya/sphinx
that referenced
this issue
May 22, 2022
Fixed by #10447. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Metadata in the docstrings (or doc-comments) of attributes is ignored; for example,
:meta public:
does not make an attribute whose name starts with an underscore public.To Reproduce
Apply
autodoc
to a class such as the following:There will be no entry generated for
_bar
.Expected behavior
The attribute
_bar
above should be listed in the generated documentation.Your project
Here is a tiny project using the example above: example.zip
Environment info
3.x
branch)sphinx.ext.autodoc
Additional context
The cause of the bug is that
autodoc.Documenter.filter_members
does not properly look up the docstring/doc-comments for attributes when searching for metadata. The following patch seems to fix the problem (I haven't made a PR since I'm not at all sure that this is the right way to do it):The text was updated successfully, but these errors were encountered: