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

sphinx.domain.python.filter_meta_fields fails to remove more than one meta-field from a field_list #10456

Closed
akruis opened this issue May 16, 2022 · 0 comments

Comments

@akruis
Copy link

akruis commented May 16, 2022

Describe the bug

If a field list contains more then one "meta"-field, the generated documentation shows all but the first meta-field.
It is a classical coding bug: the function sphinx.domain.python.filter_meta_fields stops removing meta fields after the first meta-field.

How to Reproduce

class Class:
    _public_attribute = not_to_documented
    """blah blah

    :meta public:
    :meta hide-value:
    """

Generated documentation contains a box with the text Meta hide-value:.

Expected behavior

The generated documentation does not contain any traces of the meta-fields.

Your project

Screenshots

No response

OS

Linux

Python version

3.6

Sphinx version

5.x and 4.5.x

Sphinx extensions

sphinx.ext.autodoc

Extra tools

No response

Additional context

The function filter_meta_fields was introduced by commit b968bb9, which closes #6830
I'll provide a pull request with a test and a fix.

akruis pushed a commit to scVENUS/sphinx that referenced this issue May 16, 2022
Add two meta-fields to an appropriate test case.
Currently the test fails, because of bug sphinx-doc#10456.
The next commit fixes the issue.
akruis pushed a commit to scVENUS/sphinx that referenced this issue May 16, 2022
The function now removes all "meta"-fields from a field-list.
akruis pushed a commit to scVENUS/sphinx that referenced this issue May 16, 2022
tk0miya added a commit that referenced this issue May 22, 2022
closes #10456: test and fix for sphinx.domain.python.filter_meta_fields()
tk0miya added a commit that referenced this issue May 22, 2022
@tk0miya tk0miya added this to the 5.0.0 milestone May 22, 2022
@tk0miya tk0miya closed this as completed May 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants