Skip to content

Commit 52ea0df

Browse files
authored
Merge branch 'main' into main
2 parents 497aeb1 + a85de91 commit 52ea0df

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ jobs:
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
@@ -47,7 +46,10 @@ jobs:
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 }}

docs/release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Latest Changes
44

5+
## 0.0.27
6+
7+
### Upgrades
8+
9+
* ⬆️ Add support for Python 3.14. PR [#1578](https://github.com/fastapi/sqlmodel/pull/1578) by [@svlandeg](https://github.com/svlandeg).
10+
511
## 0.0.26
612

713
### Fixes

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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",

sqlmodel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.0.26"
1+
__version__ = "0.0.27"
22

33
# Re-export from SQLAlchemy
44
from sqlalchemy.engine import create_engine as create_engine

sqlmodel/_compat.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import types
23
from contextlib import contextmanager
34
from 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", {})

0 commit comments

Comments
 (0)