File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 2626 strategy :
2727 matrix :
2828 os : [ ubuntu-latest, windows-latest, macos-latest ]
29- python-version : [ "3.13 " ]
29+ python-version : [ "3.14 " ]
3030 pydantic-version :
31- - pydantic-v1
3231 - pydantic-v2
3332 include :
3433 - os : macos-latest
4746 python-version : " 3.12"
4847 pydantic-version : pydantic-v1
4948 - os : ubuntu-latest
50- python-version : " 3.12"
49+ python-version : " 3.13"
50+ pydantic-version : pydantic-v1
51+ - os : macos-latest
52+ python-version : " 3.13"
5153 pydantic-version : pydantic-v2
5254 fail-fast : false
5355 runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ classifiers = [
2626 " Programming Language :: Python :: 3.11" ,
2727 " Programming Language :: Python :: 3.12" ,
2828 " Programming Language :: Python :: 3.13" ,
29+ " Programming Language :: Python :: 3.14" ,
2930 " Topic :: Database" ,
3031 " Topic :: Database :: Database Engines/Servers" ,
3132 " Topic :: Internet" ,
Original file line number Diff line number Diff line change 1+ import sys
12import types
23from contextlib import contextmanager
34from contextvars import ContextVar
@@ -123,7 +124,20 @@ def init_pydantic_private_attrs(new_object: InstanceOrType["SQLModel"]) -> None:
123124 object .__setattr__ (new_object , "__pydantic_private__" , None )
124125
125126 def get_annotations (class_dict : Dict [str , Any ]) -> Dict [str , Any ]:
126- return class_dict .get ("__annotations__" , {}) # type: ignore[no-any-return]
127+ raw_annotations : Dict [str , Any ] = class_dict .get ("__annotations__" , {})
128+ if sys .version_info >= (3 , 14 ) and "__annotations__" not in class_dict :
129+ # See https://github.com/pydantic/pydantic/pull/11991
130+ from annotationlib import (
131+ Format ,
132+ call_annotate_function ,
133+ get_annotate_from_class_namespace ,
134+ )
135+
136+ if annotate := get_annotate_from_class_namespace (class_dict ):
137+ raw_annotations = call_annotate_function (
138+ annotate , format = Format .FORWARDREF
139+ )
140+ return raw_annotations
127141
128142 def is_table_model_class (cls : Type [Any ]) -> bool :
129143 config = getattr (cls , "model_config" , {})
You can’t perform that action at this time.
0 commit comments