From 31630d7136b102f55e71a044e5094aee88974204 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 22 Sep 2025 14:51:20 +0200 Subject: [PATCH] [docutils] Update to 0.22.1 (#14737) --- stubs/docutils/@tests/stubtest_allowlist.txt | 16 +------------- stubs/docutils/METADATA.toml | 2 +- .../docutils/docutils/parsers/rst/states.pyi | 21 ++++++++----------- .../docutils/writers/latex2e/__init__.pyi | 4 ++-- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/stubs/docutils/@tests/stubtest_allowlist.txt b/stubs/docutils/@tests/stubtest_allowlist.txt index 5e747c667..25b1f0486 100644 --- a/stubs/docutils/@tests/stubtest_allowlist.txt +++ b/stubs/docutils/@tests/stubtest_allowlist.txt @@ -21,18 +21,4 @@ docutils.parsers.recommonmark_wrapper docutils.writers.odf_odt.pygmentsformatter # import `pygments` third-party library # `TYPE_CHECKING` variable is for internal use: -docutils.TYPE_CHECKING -docutils.core.TYPE_CHECKING -docutils.examples.TYPE_CHECKING -docutils.frontend.TYPE_CHECKING -docutils.io.TYPE_CHECKING -docutils.languages.TYPE_CHECKING -docutils.nodes.TYPE_CHECKING -docutils.parsers.TYPE_CHECKING -docutils.parsers.rst.directives.TYPE_CHECKING -docutils.parsers.rst.directives.misc.TYPE_CHECKING -docutils.parsers.rst.languages.TYPE_CHECKING -docutils.readers.TYPE_CHECKING -docutils.utils.TYPE_CHECKING -docutils.writers.TYPE_CHECKING -docutils.writers._html_base.TYPE_CHECKING +docutils.*\.TYPE_CHECKING diff --git a/stubs/docutils/METADATA.toml b/stubs/docutils/METADATA.toml index b556aa79a..6bef77369 100644 --- a/stubs/docutils/METADATA.toml +++ b/stubs/docutils/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.22.*" +version = "0.22.1" upstream_repository = "https://sourceforge.net/p/docutils/code" diff --git a/stubs/docutils/docutils/parsers/rst/states.pyi b/stubs/docutils/docutils/parsers/rst/states.pyi index 5f9b79d28..05e0c556f 100644 --- a/stubs/docutils/docutils/parsers/rst/states.pyi +++ b/stubs/docutils/docutils/parsers/rst/states.pyi @@ -26,6 +26,7 @@ class RSTStateMachine(StateMachineWS[list[str]]): document: nodes.document reporter: Reporter node: nodes.document | None + section_level_offset: int def run( # type: ignore[override] self, input_lines: Sequence[str] | StringList, @@ -35,13 +36,9 @@ class RSTStateMachine(StateMachineWS[list[str]]): inliner: Inliner | None = None, ) -> None: ... -class NestedStateMachine(StateMachineWS[list[str]]): - match_titles: bool - memo: Incomplete - document: nodes.document - reporter: Reporter - language: Incomplete - node: Incomplete +class NestedStateMachine(RSTStateMachine): + parent_state_machine: Incomplete | None + def __init__(self, state_classes, initial_state, debug: bool = False, parent_state_machine=None) -> None: ... def run( # type: ignore[override] self, input_lines: Sequence[str] | StringList, input_offset: int, memo, node, match_titles: bool = True ) -> list[str]: ... @@ -61,13 +58,13 @@ class RSTState(StateWS[list[str]]): def bof(self, context: list[str]): ... def nested_parse( self, - block, + block: StringList, input_offset: int, - node, + node: nodes.Element | None = None, match_titles: bool = False, - state_machine_class: type[StateMachine[list[str]]] | None = None, - state_machine_kwargs=None, - ): ... + state_machine_class: StateMachineWS[Incomplete] | None = None, + state_machine_kwargs: dict[Incomplete, Incomplete] | None = None, + ) -> int: ... def nested_list_parse( self, block, diff --git a/stubs/docutils/docutils/writers/latex2e/__init__.pyi b/stubs/docutils/docutils/writers/latex2e/__init__.pyi index a66025fc3..ed51fd8a5 100644 --- a/stubs/docutils/docutils/writers/latex2e/__init__.pyi +++ b/stubs/docutils/docutils/writers/latex2e/__init__.pyi @@ -216,8 +216,8 @@ class LaTeXTranslator(nodes.NodeVisitor): def attval(self, text: str, whitespace: re.Pattern[str] = ...) -> str: ... def is_inline(self, node: nodes.Node) -> bool: ... def ids_to_labels( - self, node: nodes.Element, set_anchor: bool = True, protect: bool = False, newline: bool = False - ) -> list[Incomplete]: ... + self, node: nodes.Element, set_anchor: bool = True, protect: bool = False, newline: bool = False, pre_nl: bool = False + ) -> list[str]: ... def append_hypertargets(self, node: nodes.Element) -> None: ... def set_align_from_classes(self, node) -> None: ... def insert_align_declaration(self, node: nodes.Element, default: str | None = None) -> None: ...