From 07d854dcec74c8a67d353836553092dcd329beb2 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Wed, 19 Jul 2023 10:46:04 +0200 Subject: [PATCH] docutils is migrationg to argparse. --- pospell.py | 28 +++++----------------------- pyproject.toml | 4 +++- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/pospell.py b/pospell.py index 122a244..ca36a39 100644 --- a/pospell.py +++ b/pospell.py @@ -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("", settings=settings) diff --git a/pyproject.toml b/pyproject.toml index a550768..b374762 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] \ No newline at end of file