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

Fix docutils deprecated set_class method #14706

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

nikola-matic
Copy link
Collaborator

@nikola-matic nikola-matic commented Nov 28, 2023

def set_class(self, name):
    """Add a new class to the "classes" attribute."""
    warnings.warn('docutils.nodes.Element.set_class() is deprecated; '
                  ' and will be removed in Docutils 0.21 or later.'
                  "Append to Element['classes'] list attribute directly",
                  DeprecationWarning, stacklevel=2)
    assert ' ' not in name
    self['classes'].append(name.lower())

Didn't find a mention of the deprecation in their docs, so dug it out in code. Also, the spinx-build output is pretty useless, so for future reference, add a -T option for more verbose output when necessary.

@r0qs
Copy link
Member

r0qs commented Nov 28, 2023

def set_class(self, name):
    """Add a new class to the "classes" attribute."""
    warnings.warn('docutils.nodes.Element.set_class() is deprecated; '
                  ' and will be removed in Docutils 0.21 or later.'
                  "Append to Element['classes'] list attribute directly",
                  DeprecationWarning, stacklevel=2)
    assert ' ' not in name
    self['classes'].append(name.lower())

Didn't find a mention of the deprecation in their docs, so dug it out in code. Also, the spinx-build output is pretty useless, so for future reference, add a -T option for more verbose output when necessary.

This is the only thing I found about it in their repo: https://sourceforge.net/p/docutils/bugs/463/. I'm wondering how did you run in a issue with the current version.

@r0qs
Copy link
Member

r0qs commented Nov 28, 2023

@r0qs r0qs enabled auto-merge November 28, 2023 14:03
Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see in the rendered docs that the right classes still get added with this change so it's good.

@r0qs r0qs merged commit cfdd2e0 into develop Nov 28, 2023
2 checks passed
@r0qs r0qs deleted the fix-docutils-deprecated-set-class branch November 28, 2023 14:32
r0qs added a commit to solidity-docs/zh-chinese that referenced this pull request Jun 17, 2024
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.

4 participants