-
Notifications
You must be signed in to change notification settings - Fork 198
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 0.19 deprecation warnings #612
Comments
For downstream users: If you run into this warning in pytest, this warning filter can hold you over: # setup.cfg
[tool:pytest]
filterwarnings =
ignore:The frontend.Option(Parser)? class.*:DeprecationWarning:: |
Use new API: if docutils.__version_info__[:2] >= (0, 19):
settings = frontend.get_default_settings(parser_cls)
else:
settings = OptionParser(components=(parser_cls,)).get_default_values()
Global ignore (and ensure you aren't relying on any behaviour from warnings.filterwarnings('ignore', 'The frontend.Option class .*',
DeprecationWarning, module='docutils.frontend')
Either switch your default, ignore the warning, or propagate to users
see above
Local ignore with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning)
# DeprecationWarning: The frontend.OptionParser class will be replaced
# by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
OptionParser(components=(Parser,)).print_help(stream)
Not enough context here, but don't use
Not enough context
Same as above. Hopefully helpful, |
Cheers @AA-Turner |
Running the test suite (with
tox
command) now gives the following warnings:Perhaps @AA-Turner could suggest any suitable fixes?
The text was updated successfully, but these errors were encountered: