diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-06-12 12:46:20 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-06-12 12:50:45 -0700 |
commit | 39d164f0c33d24f40e676aac152dfe50f2c00695 (patch) | |
tree | 6b75810edf7fd194338ce04441864248d3bf090f /meta-python/recipes-devtools/python/python3-pydantic-core | |
parent | 3eb7dd257b74b04fe6d513144eb988159fa501a0 (diff) | |
download | meta-openembedded-39d164f0c33d24f40e676aac152dfe50f2c00695.tar.gz |
python3-pydantic-core: Fix build with python 3.12.4
This needs to be upgraded to 2.19+ but until then
backport a fix to keep it building.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Tim Orling <ticotimo@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-pydantic-core')
-rw-r--r-- | meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch b/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch new file mode 100644 index 0000000000..f6aa18e303 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pydantic-core/0001-Fix-generate_self_schema-for-Python-3.12-1299.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 0dcca2ed6a83ebbc944ec8cbd2f67ffec8043461 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||
3 | Date: Wed, 22 May 2024 07:44:10 -0700 | ||
4 | Subject: [PATCH] Fix generate_self_schema for Python 3.12+ (#1299) | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/pydantic/pydantic-core/commit/a7620419383a69bd2b28ab953c9a17f6ed35bb9a] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | generate_self_schema.py | 7 ++++++- | ||
10 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/generate_self_schema.py b/generate_self_schema.py | ||
13 | index 8d27247..109fca0 100644 | ||
14 | --- a/generate_self_schema.py | ||
15 | +++ b/generate_self_schema.py | ||
16 | @@ -189,7 +189,12 @@ def all_literal_values(type_: type[core_schema.Literal]) -> list[any]: | ||
17 | |||
18 | def eval_forward_ref(type_: Any) -> Any: | ||
19 | try: | ||
20 | - return type_._evaluate(core_schema.__dict__, None, set()) | ||
21 | + try: | ||
22 | + # Python 3.12+ | ||
23 | + return type_._evaluate(core_schema.__dict__, None, type_params=set(), recursive_guard=set()) | ||
24 | + except TypeError: | ||
25 | + # Python 3.9+ | ||
26 | + return type_._evaluate(core_schema.__dict__, None, set()) | ||
27 | except TypeError: | ||
28 | # for Python 3.8 | ||
29 | return type_._evaluate(core_schema.__dict__, None) | ||