From 23e298f0a510625e2400a864751e49981f70a208 Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Thu, 2 Oct 2025 11:32:09 +0000 Subject: [PATCH 1/7] Add types for xmldiff --- pyrightconfig.stricter.json | 1 + stubs/xmldiff/METADATA.toml | 3 + stubs/xmldiff/xmldiff/__init__.pyi | 0 stubs/xmldiff/xmldiff/actions.pyi | 58 ++++++++++++++++ stubs/xmldiff/xmldiff/diff.pyi | 35 ++++++++++ stubs/xmldiff/xmldiff/diff_match_patch.pyi | 58 ++++++++++++++++ stubs/xmldiff/xmldiff/formatting.pyi | 80 ++++++++++++++++++++++ stubs/xmldiff/xmldiff/main.pyi | 70 +++++++++++++++++++ stubs/xmldiff/xmldiff/patch.pyi | 12 ++++ stubs/xmldiff/xmldiff/utils.pyi | 16 +++++ 10 files changed, 333 insertions(+) create mode 100644 stubs/xmldiff/METADATA.toml create mode 100644 stubs/xmldiff/xmldiff/__init__.pyi create mode 100644 stubs/xmldiff/xmldiff/actions.pyi create mode 100644 stubs/xmldiff/xmldiff/diff.pyi create mode 100644 stubs/xmldiff/xmldiff/diff_match_patch.pyi create mode 100644 stubs/xmldiff/xmldiff/formatting.pyi create mode 100644 stubs/xmldiff/xmldiff/main.pyi create mode 100644 stubs/xmldiff/xmldiff/patch.pyi create mode 100644 stubs/xmldiff/xmldiff/utils.pyi diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 99c3312723cc..e1ac57dc5fcf 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -92,6 +92,7 @@ "stubs/tqdm", "stubs/vobject", "stubs/workalendar", + "stubs/xmldiff", ], "typeCheckingMode": "strict", // TODO: Complete incomplete stubs diff --git a/stubs/xmldiff/METADATA.toml b/stubs/xmldiff/METADATA.toml new file mode 100644 index 000000000000..15a59afe3335 --- /dev/null +++ b/stubs/xmldiff/METADATA.toml @@ -0,0 +1,3 @@ +version = "2.7.*" +upstream_repository = "https://github.com/Shoobx/xmldiff" +requires = ["lxml"] diff --git a/stubs/xmldiff/xmldiff/__init__.pyi b/stubs/xmldiff/xmldiff/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/xmldiff/xmldiff/actions.pyi b/stubs/xmldiff/xmldiff/actions.pyi new file mode 100644 index 000000000000..f24f585bd487 --- /dev/null +++ b/stubs/xmldiff/xmldiff/actions.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete +from typing import NamedTuple + +class DeleteNode(NamedTuple): + node: str + +class InsertNode(NamedTuple): + target: Incomplete + tag: str + position: int + +class RenameNode(NamedTuple): + node: str + tag: Incomplete + +class MoveNode(NamedTuple): + node: str + target: Incomplete + position: int + +class UpdateTextIn(NamedTuple): + node: str + text: Incomplete + +class UpdateTextAfter(NamedTuple): + node: str + text: Incomplete + +class UpdateAttrib(NamedTuple): + node: str + name: str + value: Incomplete + +class DeleteAttrib(NamedTuple): + node: str + name: str + +class InsertAttrib(NamedTuple): + node: str + name: str + value: Incomplete + +class RenameAttrib(NamedTuple): + node: str + oldname: str + newname: str + +class InsertComment(NamedTuple): + target: Incomplete + position: Incomplete + text: Incomplete + +class InsertNamespace(NamedTuple): + prefix: str + uri: str + +class DeleteNamespace(NamedTuple): + prefix: str diff --git a/stubs/xmldiff/xmldiff/diff.pyi b/stubs/xmldiff/xmldiff/diff.pyi new file mode 100644 index 000000000000..418451f9b55a --- /dev/null +++ b/stubs/xmldiff/xmldiff/diff.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete +from collections.abc import Generator + +class Differ: + F: float + uniqueattrs: Incomplete + fast_match: Incomplete + best_match: Incomplete + ignored_attrs: Incomplete + def __init__( + self, + F: float | None = None, + uniqueattrs=None, + ratio_mode: str = "fast", + fast_match: bool = False, + best_match: bool = False, + ignored_attrs=[], + ) -> None: ... + left: Incomplete + right: Incomplete + def clear(self) -> None: ... + def set_trees(self, left, right) -> None: ... + def append_match(self, lnode, rnode, max_match) -> None: ... + def match(self, left=None, right=None): ... + def node_ratio(self, left, right): ... + def node_text(self, node): ... + def node_attribs(self, node): ... + def leaf_ratio(self, left, right): ... + def child_ratio(self, left, right): ... + def update_node_tag(self, left, right) -> Generator[Incomplete]: ... + def update_node_attr(self, left, right) -> Generator[Incomplete]: ... + def update_node_text(self, left, right) -> Generator[Incomplete]: ... + def find_pos(self, node): ... + def align_children(self, left, right) -> Generator[Incomplete, None, Incomplete]: ... + def diff(self, left=None, right=None) -> Generator[Incomplete, Incomplete]: ... diff --git a/stubs/xmldiff/xmldiff/diff_match_patch.pyi b/stubs/xmldiff/xmldiff/diff_match_patch.pyi new file mode 100644 index 000000000000..476b35acc453 --- /dev/null +++ b/stubs/xmldiff/xmldiff/diff_match_patch.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +class diff_match_patch: + Diff_Timeout: float + Diff_EditCost: int + Match_Threshold: float + Match_Distance: int + Patch_DeleteThreshold: float + Patch_Margin: int + Match_MaxBits: int + def __init__(self) -> None: ... + DIFF_DELETE: int + DIFF_INSERT: int + DIFF_EQUAL: int + DIFF_REPLACE: int + def diff_main(self, text1, text2, checklines: bool = True, deadline=None): ... + def diff_compute(self, text1, text2, checklines, deadline): ... + def diff_lineMode(self, text1, text2, deadline): ... + def diff_bisect(self, text1, text2, deadline): ... + def diff_bisectSplit(self, text1, text2, x, y, deadline): ... + def diff_linesToChars(self, text1, text2): ... + def diff_charsToLines(self, diffs, lineArray) -> None: ... + def diff_commonPrefix(self, text1, text2): ... + def diff_commonSuffix(self, text1, text2): ... + def diff_commonOverlap(self, text1, text2): ... + def diff_halfMatch(self, text1, text2): ... + def diff_cleanupSemantic(self, diffs) -> None: ... + def diff_cleanupSemanticLossless(self, diffs): ... + BLANKLINEEND: Incomplete + BLANKLINESTART: Incomplete + def diff_cleanupEfficiency(self, diffs) -> None: ... + def diff_cleanupMerge(self, diffs) -> None: ... + def diff_xIndex(self, diffs, loc): ... + def diff_prettyHtml(self, diffs): ... + def diff_text1(self, diffs): ... + def diff_text2(self, diffs): ... + def diff_levenshtein(self, diffs): ... + def diff_toDelta(self, diffs): ... + def diff_fromDelta(self, text1, delta): ... + def match_main(self, text, pattern, loc): ... + def match_bitap(self, text, pattern, loc): ... + def match_alphabet(self, pattern): ... + def patch_addContext(self, patch, text) -> None: ... + def patch_make(self, a, b=None, c=None): ... + def patch_deepCopy(self, patches): ... + def patch_apply(self, patches, text): ... + def patch_addPadding(self, patches): ... + def patch_splitMax(self, patches) -> None: ... + def patch_toText(self, patches): ... + def patch_fromText(self, textline): ... + +class patch_obj: + diffs: Incomplete + start1: Incomplete + start2: Incomplete + length1: int + length2: int + def __init__(self) -> None: ... diff --git a/stubs/xmldiff/xmldiff/formatting.pyi b/stubs/xmldiff/xmldiff/formatting.pyi new file mode 100644 index 000000000000..6c36e3497ea4 --- /dev/null +++ b/stubs/xmldiff/xmldiff/formatting.pyi @@ -0,0 +1,80 @@ +from _typeshed import Incomplete +from collections.abc import Generator +from typing import NamedTuple + +DIFF_NS: str +DIFF_PREFIX: str +INSERT_NAME: Incomplete +DELETE_NAME: Incomplete +REPLACE_NAME: Incomplete +RENAME_NAME: Incomplete +WS_BOTH: int +WS_TEXT: int +WS_TAGS: int +WS_NONE: int +T_OPEN: int +T_CLOSE: int +T_SINGLE: int +PLACEHOLDER_START: int + +class BaseFormatter: + def __init__(self, normalize=1, pretty_print: bool = False) -> None: ... + def prepare(self, left_tree, right_tree) -> None: ... + def format(self, diff, orig_tree) -> None: ... + +class PlaceholderEntry(NamedTuple): + element: Incomplete + ttype: Incomplete + close_ph: Incomplete + +class PlaceholderMaker: + text_tags: Incomplete + formatting_tags: Incomplete + placeholder2tag: Incomplete + tag2placeholder: Incomplete + placeholder: Incomplete + diff_tags: Incomplete + def __init__(self, text_tags=(), formatting_tags=()) -> None: ... + def get_placeholder(self, element, ttype, close_ph): ... + def is_placeholder(self, char): ... + def is_formatting(self, element): ... + def do_element(self, element) -> None: ... + def do_tree(self, tree) -> None: ... + def split_string(self, text): ... + def undo_string(self, text): ... + def undo_element(self, elem) -> None: ... + def undo_tree(self, tree) -> None: ... + def mark_diff(self, ph, action, attributes=None): ... + def wrap_diff(self, text, action, attributes=None): ... + +class XMLFormatter(BaseFormatter): + normalize: Incomplete + pretty_print: Incomplete + text_tags: Incomplete + formatting_tags: Incomplete + use_replace: Incomplete + placeholderer: Incomplete + def __init__( + self, normalize=0, pretty_print: bool = True, text_tags=(), formatting_tags=(), use_replace: bool = False + ) -> None: ... + def prepare(self, left_tree, right_tree) -> None: ... + def finalize(self, result_tree) -> None: ... + def format(self, diff, orig_tree, differ=None): ... + def render(self, result): ... + def handle_action(self, action, result) -> None: ... + +class DiffFormatter(BaseFormatter): + normalize: Incomplete + def __init__(self, normalize=1, pretty_print: bool = False) -> None: ... + def prepare(self, left, right) -> None: ... + def finalize(self, left, right) -> None: ... + def format(self, diff, orig_tree): ... + def handle_action(self, action): ... + +class XmlDiffFormatter(BaseFormatter): + normalize: Incomplete + def __init__(self, normalize=1, pretty_print: bool = False) -> None: ... + def prepare(self, left, right) -> None: ... + def finalize(self, left, right) -> None: ... + def format(self, diff, orig_tree): ... + def handle_action(self, action, orig_tree) -> Generator[Incomplete, Incomplete]: ... diff --git a/stubs/xmldiff/xmldiff/main.pyi b/stubs/xmldiff/xmldiff/main.pyi new file mode 100644 index 000000000000..25956dd3908b --- /dev/null +++ b/stubs/xmldiff/xmldiff/main.pyi @@ -0,0 +1,70 @@ +from argparse import ArgumentParser +from collections.abc import Iterable, Mapping, Sequence +from typing import Any, overload +from typing_extensions import TypeAlias + +from lxml.etree import ElementTree +from xmldiff.actions import ( + DeleteAttrib, + DeleteNamespace, + DeleteNode, + InsertAttrib, + InsertComment, + InsertNamespace, + InsertNode, + MoveNode, + RenameAttrib, + RenameNode, + UpdateAttrib, + UpdateTextAfter, + UpdateTextIn, +) +from xmldiff.formatting import BaseFormatter + +__version__: str +FORMATTERS: Mapping[str, BaseFormatter] + +_ACTIONS: TypeAlias = ( + DeleteNode + | InsertNode + | RenameNode + | MoveNode + | UpdateTextIn + | UpdateTextAfter + | UpdateAttrib + | DeleteAttrib + | InsertAttrib + | RenameAttrib + | InsertComment + | InsertNamespace + | DeleteNamespace +) + +@overload +def diff_trees( + left: ElementTree, right: ElementTree, diff_options: dict[str, Any] | None = None, formatter: None = None +) -> Iterable[_ACTIONS]: ... +@overload +def diff_trees( + left: ElementTree, right: ElementTree, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ... +) -> str: ... +@overload +def diff_texts( + left: str, right: str, diff_options: dict[str, Any] | None = None, formatter: None = None +) -> Iterable[_ACTIONS]: ... +@overload +def diff_texts(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... +@overload +def diff_files( + left: str, right: str, diff_options: dict[str, Any] | None = None, formatter: None = None +) -> Iterable[_ACTIONS]: ... +@overload +def diff_files(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... +def validate_F(arg: float | str) -> float: ... +def make_diff_parser() -> ArgumentParser: ... +def diff_command(args: Sequence[str] | None = None) -> int | None: ... +def patch_tree(actions, tree): ... +def patch_text(actions, tree): ... +def patch_file(actions, tree, diff_encoding=None): ... +def make_patch_parser(): ... +def patch_command(args=None) -> None: ... diff --git a/stubs/xmldiff/xmldiff/patch.pyi b/stubs/xmldiff/xmldiff/patch.pyi new file mode 100644 index 000000000000..6be3cfb8345d --- /dev/null +++ b/stubs/xmldiff/xmldiff/patch.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete +from collections.abc import Generator + +class Patcher: + @property + def nsmap(self): ... + def patch(self, actions, tree): ... + def handle_action(self, action, tree) -> None: ... + +class DiffParser: + def parse(self, diff) -> Generator[Incomplete]: ... + def make_action(self, line): ... diff --git a/stubs/xmldiff/xmldiff/utils.pyi b/stubs/xmldiff/xmldiff/utils.pyi new file mode 100644 index 000000000000..264fb6023e25 --- /dev/null +++ b/stubs/xmldiff/xmldiff/utils.pyi @@ -0,0 +1,16 @@ +from _typeshed import Incomplete +from collections.abc import Generator +from re import Pattern + +RESERVED_NS: Pattern[str] + +def post_order_traverse(node) -> Generator[Incomplete, Incomplete]: ... +def reverse_post_order_traverse(node) -> Generator[Incomplete, Incomplete]: ... +def breadth_first_traverse(node) -> Generator[Incomplete]: ... +def longest_common_subsequence(left_sequence, right_sequence, eqfn=...): ... + +WHITESPACE: Incomplete + +def cleanup_whitespace(text): ... +def getpath(element, tree=None): ... +def make_ascii_tree(element): ... From 6e2d92bc58db4ea605560a6dd572ed004830eaac Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Thu, 2 Oct 2025 11:37:03 +0000 Subject: [PATCH 2/7] Fix --- stubs/xmldiff/METADATA.toml | 1 + stubs/xmldiff/xmldiff/main.pyi | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/stubs/xmldiff/METADATA.toml b/stubs/xmldiff/METADATA.toml index 15a59afe3335..fe9e9770f4b3 100644 --- a/stubs/xmldiff/METADATA.toml +++ b/stubs/xmldiff/METADATA.toml @@ -1,3 +1,4 @@ version = "2.7.*" upstream_repository = "https://github.com/Shoobx/xmldiff" requires = ["lxml"] +stubtest_requirements- = ["lxml-stubs"] \ No newline at end of file diff --git a/stubs/xmldiff/xmldiff/main.pyi b/stubs/xmldiff/xmldiff/main.pyi index 25956dd3908b..4bfb3657f918 100644 --- a/stubs/xmldiff/xmldiff/main.pyi +++ b/stubs/xmldiff/xmldiff/main.pyi @@ -3,7 +3,7 @@ from collections.abc import Iterable, Mapping, Sequence from typing import Any, overload from typing_extensions import TypeAlias -from lxml.etree import ElementTree +from lxml.etree import _ElementTree as ET from xmldiff.actions import ( DeleteAttrib, DeleteNamespace, @@ -42,24 +42,24 @@ _ACTIONS: TypeAlias = ( @overload def diff_trees( - left: ElementTree, right: ElementTree, diff_options: dict[str, Any] | None = None, formatter: None = None -) -> Iterable[_ACTIONS]: ... + left: ET, right: ET, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ... +) -> str: ... @overload def diff_trees( - left: ElementTree, right: ElementTree, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ... -) -> str: ... + left: ET, right: ET, diff_options: dict[str, Any] | None = None, formatter: None = None +) -> Iterable[_ACTIONS]: ... +@overload +def diff_texts(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... @overload def diff_texts( left: str, right: str, diff_options: dict[str, Any] | None = None, formatter: None = None ) -> Iterable[_ACTIONS]: ... @overload -def diff_texts(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... +def diff_files(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... @overload def diff_files( left: str, right: str, diff_options: dict[str, Any] | None = None, formatter: None = None ) -> Iterable[_ACTIONS]: ... -@overload -def diff_files(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... def validate_F(arg: float | str) -> float: ... def make_diff_parser() -> ArgumentParser: ... def diff_command(args: Sequence[str] | None = None) -> int | None: ... From 3dfb9b58e96e85c9cbd686669dbefb8905275774 Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Mon, 6 Oct 2025 12:24:52 +0000 Subject: [PATCH 3/7] Fix toml --- stubs/xmldiff/METADATA.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stubs/xmldiff/METADATA.toml b/stubs/xmldiff/METADATA.toml index fe9e9770f4b3..faa755125a6e 100644 --- a/stubs/xmldiff/METADATA.toml +++ b/stubs/xmldiff/METADATA.toml @@ -1,4 +1,6 @@ version = "2.7.*" upstream_repository = "https://github.com/Shoobx/xmldiff" requires = ["lxml"] -stubtest_requirements- = ["lxml-stubs"] \ No newline at end of file + +[tool.stubtest] +stubtest_requirements- = ["lxml-stubs"] From fd542e65c5399bc2469b937d647f8addd4725646 Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Mon, 6 Oct 2025 12:28:28 +0000 Subject: [PATCH 4/7] Fix pre-commit --- stubs/xmldiff/xmldiff/main.pyi | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stubs/xmldiff/xmldiff/main.pyi b/stubs/xmldiff/xmldiff/main.pyi index 4bfb3657f918..c393476e1182 100644 --- a/stubs/xmldiff/xmldiff/main.pyi +++ b/stubs/xmldiff/xmldiff/main.pyi @@ -41,13 +41,9 @@ _ACTIONS: TypeAlias = ( ) @overload -def diff_trees( - left: ET, right: ET, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ... -) -> str: ... +def diff_trees(left: ET, right: ET, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... @overload -def diff_trees( - left: ET, right: ET, diff_options: dict[str, Any] | None = None, formatter: None = None -) -> Iterable[_ACTIONS]: ... +def diff_trees(left: ET, right: ET, diff_options: dict[str, Any] | None = None, formatter: None = None) -> Iterable[_ACTIONS]: ... @overload def diff_texts(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... @overload From f8ddd0eff7950bd7e4178e5755f89d8c00248f41 Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Mon, 6 Oct 2025 12:43:15 +0000 Subject: [PATCH 5/7] Fix --- stubs/xmldiff/METADATA.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stubs/xmldiff/METADATA.toml b/stubs/xmldiff/METADATA.toml index faa755125a6e..29ceada25271 100644 --- a/stubs/xmldiff/METADATA.toml +++ b/stubs/xmldiff/METADATA.toml @@ -1,6 +1,3 @@ version = "2.7.*" upstream_repository = "https://github.com/Shoobx/xmldiff" -requires = ["lxml"] - -[tool.stubtest] -stubtest_requirements- = ["lxml-stubs"] +requires = ["lxml-stubs"] From abaa9a313f9c31d82846917145e697508eee73bb Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Tue, 7 Oct 2025 05:13:33 +0000 Subject: [PATCH 6/7] Fix lxml --- stubs/xmldiff/METADATA.toml | 1 - stubs/xmldiff/xmldiff/main.pyi | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stubs/xmldiff/METADATA.toml b/stubs/xmldiff/METADATA.toml index 29ceada25271..0d59b5fa34e8 100644 --- a/stubs/xmldiff/METADATA.toml +++ b/stubs/xmldiff/METADATA.toml @@ -1,3 +1,2 @@ version = "2.7.*" upstream_repository = "https://github.com/Shoobx/xmldiff" -requires = ["lxml-stubs"] diff --git a/stubs/xmldiff/xmldiff/main.pyi b/stubs/xmldiff/xmldiff/main.pyi index c393476e1182..fba5c33a1ce8 100644 --- a/stubs/xmldiff/xmldiff/main.pyi +++ b/stubs/xmldiff/xmldiff/main.pyi @@ -3,7 +3,6 @@ from collections.abc import Iterable, Mapping, Sequence from typing import Any, overload from typing_extensions import TypeAlias -from lxml.etree import _ElementTree as ET from xmldiff.actions import ( DeleteAttrib, DeleteNamespace, @@ -39,11 +38,14 @@ _ACTIONS: TypeAlias = ( | InsertNamespace | DeleteNamespace ) +_ET: TypeAlias = Any # lxml.etree._ElementTree @overload -def diff_trees(left: ET, right: ET, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... +def diff_trees(left: _ET, right: _ET, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... @overload -def diff_trees(left: ET, right: ET, diff_options: dict[str, Any] | None = None, formatter: None = None) -> Iterable[_ACTIONS]: ... +def diff_trees( + left: _ET, right: _ET, diff_options: dict[str, Any] | None = None, formatter: None = None +) -> Iterable[_ACTIONS]: ... @overload def diff_texts(left: str, right: str, *, diff_options: dict[str, Any] | None = None, formatter: BaseFormatter = ...) -> str: ... @overload From 3524f1827eb14eaafd89c5c1267bacbe6866d5e9 Mon Sep 17 00:00:00 2001 From: Kai Harder Date: Tue, 7 Oct 2025 13:14:05 +0000 Subject: [PATCH 7/7] Apply comments --- stubs/xmldiff/xmldiff/diff.pyi | 3 ++- stubs/xmldiff/xmldiff/formatting.pyi | 30 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/stubs/xmldiff/xmldiff/diff.pyi b/stubs/xmldiff/xmldiff/diff.pyi index 418451f9b55a..3dff61747a35 100644 --- a/stubs/xmldiff/xmldiff/diff.pyi +++ b/stubs/xmldiff/xmldiff/diff.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete from collections.abc import Generator +from typing import Literal class Differ: F: float @@ -11,7 +12,7 @@ class Differ: self, F: float | None = None, uniqueattrs=None, - ratio_mode: str = "fast", + ratio_mode: Literal["accurate", "fast", "faster"] = "fast", fast_match: bool = False, best_match: bool = False, ignored_attrs=[], diff --git a/stubs/xmldiff/xmldiff/formatting.pyi b/stubs/xmldiff/xmldiff/formatting.pyi index 6c36e3497ea4..02399462274d 100644 --- a/stubs/xmldiff/xmldiff/formatting.pyi +++ b/stubs/xmldiff/xmldiff/formatting.pyi @@ -1,21 +1,21 @@ from _typeshed import Incomplete from collections.abc import Generator -from typing import NamedTuple +from typing import Final, NamedTuple -DIFF_NS: str -DIFF_PREFIX: str -INSERT_NAME: Incomplete -DELETE_NAME: Incomplete -REPLACE_NAME: Incomplete -RENAME_NAME: Incomplete -WS_BOTH: int -WS_TEXT: int -WS_TAGS: int -WS_NONE: int -T_OPEN: int -T_CLOSE: int -T_SINGLE: int -PLACEHOLDER_START: int +DIFF_NS: Final[str] +DIFF_PREFIX: Final[str] +INSERT_NAME: Final[Incomplete] +DELETE_NAME: Final[Incomplete] +REPLACE_NAME: Final[Incomplete] +RENAME_NAME: Final[Incomplete] +WS_BOTH: Final[int] +WS_TEXT: Final[int] +WS_TAGS: Final[int] +WS_NONE: Final[int] +T_OPEN: Final[int] +T_CLOSE: Final[int] +T_SINGLE: Final[int] +PLACEHOLDER_START: Final[int] class BaseFormatter: def __init__(self, normalize=1, pretty_print: bool = False) -> None: ...