From ca8ad657d3eca7f5724138ef6f2c6616d0027ab8 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 17 Nov 2023 13:40:08 +0100 Subject: [PATCH] [jsonschema] Bump to 4.20.* (#11036) Co-authored-by: Alex Waygood --- stubs/jsonschema/METADATA.toml | 2 +- stubs/jsonschema/jsonschema/_legacy_keywords.pyi | 8 +++++++- stubs/jsonschema/jsonschema/exceptions.pyi | 15 ++++++++------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/stubs/jsonschema/METADATA.toml b/stubs/jsonschema/METADATA.toml index 85ad912c0..eae3a4e3a 100644 --- a/stubs/jsonschema/METADATA.toml +++ b/stubs/jsonschema/METADATA.toml @@ -1,4 +1,4 @@ -version = "4.19.*" +version = "4.20.*" upstream_repository = "https://github.com/python-jsonschema/jsonschema" requires = ["referencing"] partial_stub = true diff --git a/stubs/jsonschema/jsonschema/_legacy_keywords.pyi b/stubs/jsonschema/jsonschema/_legacy_keywords.pyi index 9f541de53..e2898f8ed 100644 --- a/stubs/jsonschema/jsonschema/_legacy_keywords.pyi +++ b/stubs/jsonschema/jsonschema/_legacy_keywords.pyi @@ -1,5 +1,7 @@ from _typeshed import Incomplete -from collections.abc import ItemsView +from collections.abc import ItemsView, Iterator + +from .exceptions import ValidationError def ignore_ref_siblings(schema) -> list[tuple[str, Incomplete]] | ItemsView[str, Incomplete]: ... def dependencies_draft3(validator, dependencies, instance, schema) -> None: ... @@ -15,3 +17,7 @@ def properties_draft3(validator, properties, instance, schema) -> None: ... def type_draft3(validator, types, instance, schema) -> None: ... def contains_draft6_draft7(validator, contains, instance, schema) -> None: ... def recursiveRef(validator, recursiveRef, instance, schema) -> None: ... +def find_evaluated_item_indexes_by_schema(validator, instance, schema) -> list[int]: ... +def unevaluatedItems_draft2019(validator, unevaluatedItems, instance, schema) -> Iterator[ValidationError]: ... +def find_evaluated_property_keys_by_schema(validator, instance, schema) -> list[Incomplete]: ... +def unevaluatedProperties_draft2019(validator, uP, instance, schema) -> Iterator[ValidationError]: ... diff --git a/stubs/jsonschema/jsonschema/exceptions.pyi b/stubs/jsonschema/jsonschema/exceptions.pyi index 646a67895..5cbbdaa40 100644 --- a/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/stubs/jsonschema/jsonschema/exceptions.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete, SupportsRichComparison from collections import deque -from collections.abc import Callable, Container, Iterable, Sequence -from typing_extensions import Self, TypeAlias +from collections.abc import Callable, Container, Iterable, Iterator, MutableMapping, Sequence +from typing_extensions import Self, TypeAlias, deprecated from jsonschema import _utils, protocols from jsonschema._types import TypeChecker @@ -72,12 +72,13 @@ class FormatError(Exception): def __init__(self, message, cause: Incomplete | None = None) -> None: ... class ErrorTree: - errors: Incomplete - def __init__(self, errors=()) -> None: ... - def __contains__(self, index): ... + errors: MutableMapping[str, ValidationError] + def __init__(self, errors: Iterable[ValidationError] = ()) -> None: ... + def __contains__(self, index: object) -> bool: ... def __getitem__(self, index): ... - def __setitem__(self, index, value) -> None: ... - def __iter__(self): ... + @deprecated("ErrorTree.__setitem__ is deprecated without replacement.") + def __setitem__(self, index: str | int, value: ErrorTree) -> None: ... + def __iter__(self) -> Iterator[str]: ... def __len__(self) -> int: ... @property def total_errors(self): ...