Skip to content

Commit 2b27104

Browse files
authored
Update jsonschema stubs to track latest changes (#14591)
1 parent b9d1567 commit 2b27104

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

stubs/jsonschema/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "4.25.*"
1+
version = "~=4.25.1"
22
upstream_repository = "https://github.com/python-jsonschema/jsonschema"
33
requires = ["referencing"]
44

stubs/jsonschema/jsonschema/protocols.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _typeshed import Incomplete
22
from collections.abc import Iterator, Mapping, Sequence
3-
from typing import ClassVar, Protocol
3+
from typing import Any, ClassVar, Protocol
44
from typing_extensions import TypeAlias
55

66
import referencing.jsonschema
@@ -15,12 +15,14 @@ class Validator(Protocol):
1515
VALIDATORS: ClassVar[dict[Incomplete, Incomplete]]
1616
TYPE_CHECKER: ClassVar[TypeChecker]
1717
FORMAT_CHECKER: ClassVar[FormatChecker]
18-
schema: dict[Incomplete, Incomplete] | bool
18+
schema: referencing.jsonschema.Schema
1919
def __init__(
2020
self,
21-
schema: dict[Incomplete, Incomplete] | bool,
22-
registry: referencing.jsonschema.SchemaRegistry,
21+
schema: Mapping[Incomplete, Incomplete] | bool,
22+
resolver: Any = None, # deprecated
2323
format_checker: FormatChecker | None = None,
24+
*,
25+
registry: referencing.jsonschema.SchemaRegistry = ...,
2426
) -> None: ...
2527
@classmethod
2628
def check_schema(cls, schema: dict[Incomplete, Incomplete]) -> None: ...

stubs/jsonschema/jsonschema/validators.pyi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _ValidatorCallback: TypeAlias = Callable[[Any, Any, _JsonValue, _JsonObject], It
2121
# This class does not exist at runtime. Compatible classes are created at
2222
# runtime by create().
2323
@type_check_only
24-
class _Validator:
24+
class _Validator(Validator):
2525
VALIDATORS: ClassVar[dict[Incomplete, Incomplete]]
2626
META_SCHEMA: ClassVar[dict[Incomplete, Incomplete]]
2727
TYPE_CHECKER: ClassVar[Incomplete]
@@ -32,12 +32,11 @@ class _Validator:
3232
format_checker: FormatChecker | None
3333
def __init__(
3434
self,
35-
schema: Schema,
36-
resolver=None,
35+
schema: Mapping[Incomplete, Incomplete] | bool,
36+
resolver: Any = None, # deprecated
3737
format_checker: FormatChecker | None = None,
3838
*,
3939
registry: SchemaRegistry = ...,
40-
_resolver=None,
4140
) -> None: ...
4241
@classmethod
4342
def check_schema(cls, schema: Schema, format_checker: FormatChecker | Unset = ...) -> None: ...

0 commit comments

Comments
 (0)