summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/python/python3-jsonschema/d71f96a6523875c9694fcdf468c9f458323d07f2.patch44
-rw-r--r--meta/recipes-devtools/python/python3-jsonschema_4.23.0.bb2
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-jsonschema/d71f96a6523875c9694fcdf468c9f458323d07f2.patch b/meta/recipes-devtools/python/python3-jsonschema/d71f96a6523875c9694fcdf468c9f458323d07f2.patch
new file mode 100644
index 0000000000..65cc2b4cf0
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-jsonschema/d71f96a6523875c9694fcdf468c9f458323d07f2.patch
@@ -0,0 +1,44 @@
1From d71f96a6523875c9694fcdf468c9f458323d07f2 Mon Sep 17 00:00:00 2001
2From: Julian Berman <Julian@GrayVines.com>
3Date: Thu, 17 Oct 2024 09:36:35 -0400
4Subject: [PATCH] Fix the annotation for validator_for's default.
5
6This still doesn't seem to satisfy mypy, so tell it to be quiet.
7
8Upstream-Status: Backport [https://github.com/python-jsonschema/jsonschema/commit/d71f96a6523875c9694fcdf468c9f458323d07f2]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 jsonschema/validators.py | 6 +++---
12 1 file changed, 3 insertions(+), 3 deletions(-)
13
14diff --git a/jsonschema/validators.py b/jsonschema/validators.py
15index 85c39160..b8ca3bd4 100644
16--- a/jsonschema/validators.py
17+++ b/jsonschema/validators.py
18@@ -857,7 +857,7 @@ def extend(
19 version="draft2020-12",
20 )
21
22-_LATEST_VERSION = Draft202012Validator
23+_LATEST_VERSION: type[Validator] = Draft202012Validator
24
25
26 class _RefResolver:
27@@ -1334,7 +1334,7 @@ def validate(instance, schema, cls=None, *args, **kwargs): # noqa: D417
28
29 def validator_for(
30 schema,
31- default: Validator | _utils.Unset = _UNSET,
32+ default: type[Validator] | _utils.Unset = _UNSET,
33 ) -> type[Validator]:
34 """
35 Retrieve the validator class appropriate for validating the given schema.
36@@ -1396,7 +1396,7 @@ class is returned:
37 DefaultValidator = _LATEST_VERSION if default is _UNSET else default
38
39 if schema is True or schema is False or "$schema" not in schema:
40- return DefaultValidator
41+ return DefaultValidator # type: ignore[return-value]
42 if schema["$schema"] not in _META_SCHEMAS and default is _UNSET:
43 warn(
44 (
diff --git a/meta/recipes-devtools/python/python3-jsonschema_4.23.0.bb b/meta/recipes-devtools/python/python3-jsonschema_4.23.0.bb
index 126258255d..82b7bb23ed 100644
--- a/meta/recipes-devtools/python/python3-jsonschema_4.23.0.bb
+++ b/meta/recipes-devtools/python/python3-jsonschema_4.23.0.bb
@@ -4,6 +4,8 @@ LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 \ 4LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 \
5 file://json/LICENSE;md5=9d4de43111d33570c8fe49b4cb0e01af" 5 file://json/LICENSE;md5=9d4de43111d33570c8fe49b4cb0e01af"
6 6
7SRC_URI += "file://d71f96a6523875c9694fcdf468c9f458323d07f2.patch"
8
7SRC_URI[sha256sum] = "d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4" 9SRC_URI[sha256sum] = "d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4"
8 10
9inherit pypi python_hatchling 11inherit pypi python_hatchling