-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Fix GH #54853: BUG: DeprecationWarning for frontend.OptionParser when building docs #54854
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 GH #54853: BUG: DeprecationWarning for frontend.OptionParser when building docs #54854
Conversation
@@ -159,10 +159,10 @@ def _get_page_title(self, page): | |||
Open the rst file `page` and extract its title. | |||
""" | |||
fname = os.path.join(SOURCE_PATH, f"{page}.rst") | |||
option_parser = docutils.frontend.OptionParser( | |||
components=(docutils.parsers.rst.Parser,) | |||
doc = docutils.utils.new_document( |
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.
Can you use something like this instead? https://stackoverflow.com/a/75996218
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 could, but my understanding from the docs is that this version allows customization through a configuration file, whereas the SO answer does not. So I'd lean on keeping it like it is, but I'm happy to change the PR if you'd prefer.
(This is assuming you're not talking about supporting docutils prior to 0.18. Otherwise let me know.)
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.
Yeah I was referring to using get_default_settings
. I would prefer using more "public" APIs from docutils rather then digging into docutils.core
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.
Updated as requested :)
…ontend.OptionParser
Thanks @DavidToneian |
…arser when building docs (pandas-dev#54854) * Fix GH pandas-dev#54853: BUG: DeprecationWarning for frontend.OptionParser when building docs See docutils/docutils@6548b56#diff-a033583f6ace19fed2adc108b1c130e17ea00e1afee38c22c993cb477ad27a5fR453 * Use `docutils.frontend.get_default_settings` instead of relying on `docutils.core`. --------- Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
frontend.OptionParser
when building docs #54853 (Replace xxxx with the GitHub issue number)doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.See docutils/docutils@6548b56#diff-a033583f6ace19fed2adc108b1c130e17ea00e1afee38c22c993cb477ad27a5fR453