-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Use normalize_options()
from Docutils in preference to set_classes()
#13844
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
base: master
Are you sure you want to change the base?
Use normalize_options()
from Docutils in preference to set_classes()
#13844
Conversation
@@ -9,7 +9,7 @@ | |||
from docutils.parsers.rst import directives | |||
from docutils.parsers.rst.directives import images, tables | |||
from docutils.parsers.rst.directives.misc import Meta | |||
from docutils.parsers.rst.roles import set_classes |
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.
We still need the old name for old versions of Docutils, which we still support
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.
OK, I suspected that this needs to be version dependent. I'll add a checker, though first will need to sort out what goes wrong for the latest docutils where it should work
normalize_options()
from Docutils in preference to set_classes()
@@ -584,10 +584,11 @@ def code_role( | |||
options: dict[str, Any] | None = None, | |||
content: Sequence[str] = (), | |||
) -> tuple[list[Node], list[system_message]]: | |||
|
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.
Ahh, and this annoys Ruff, though I explicitly added the line as it was very difficult to see where the signature ends and the actual code starts.
The one remaining failure is actually relevant as instead of the I suspect this is something trivial for someone more familiar with the sphinx testing internals, so I don't yet dive into this rabbit hole of figuring it out myself. |
@AA-Turner - any tips of how I could resolve the above issue? (the change in generated heading class) |
Purpose
We started seeing deprecations for
set_classes()
when running sphinx-automodapi tests (e.g. astropy/sphinx-automodapi#214). We don't call that method directly, but it appeared that sphinx itself calls it. Using this patch locally, those failures cleaned up.However, this patch really badly fails the sphinx tests locally, so I'm trying to smoke out issues with CI (and I expect that some docutils version checker will be needed, too. I'll add changelog/authors once this is all green and decided to be the good approach)