docutils is migrationg to argparse.

This commit is contained in:
Julien Palard 2023-07-19 10:46:04 +02:00
parent 33eb8f7f7d
commit 07d854dcec
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
2 changed files with 8 additions and 24 deletions

View File

@ -138,30 +138,12 @@ def strip_rst(line):
if line.endswith("::"):
# Drop :: at the end, it would cause Literal block expected
line = line[:-2]
settings = docutils.frontend.get_default_settings()
settings.pep_references = None
settings.rfc_references = None
settings.pep_base_url = "http://www.python.org/dev/peps/"
settings.pep_file_url_template = "pep-%04d"
parser = docutils.parsers.rst.Parser()
settings = docutils.frontend.Values(
{
"report_level": 2,
"halt_level": 4,
"exit_status_level": 5,
"debug": None,
"warning_stream": None,
"error_encoding": "utf-8",
"error_encoding_error_handler": "backslashreplace",
"language_code": "en",
"id_prefix": "",
"auto_id_prefix": "id",
"pep_references": None,
"pep_base_url": "http://www.python.org/dev/peps/",
"pep_file_url_template": "pep-%04d",
"rfc_references": None,
"rfc_base_url": "http://tools.ietf.org/html/",
"tab_width": 8,
"trim_footnote_reference_space": None,
"syntax_highlight": "long",
"line_length_limit": 10000,
}
)
stderr_stringio = io.StringIO()
with redirect_stderr(stderr_stringio):
document = new_document("<rst-doc>", settings=settings)

View File

@ -27,7 +27,7 @@ classifiers = [
requires-python = ">= 3.6"
dependencies = [
"polib",
"docutils>=0.16",
"docutils>=0.18",
"regex",
]
dynamic = [
@ -55,3 +55,5 @@ include-package-data = false
[tool.setuptools.dynamic.version]
attr = "pospell.__version__"
[tool.black]