Skip to content

Commit b1349da

Browse files
authored
⬆️ Add support for Python 3.13 (#1289)
1 parent bf376f8 commit b1349da

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- "3.10"
3333
- "3.11"
3434
- "3.12"
35+
- "3.13"
3536
pydantic-version:
3637
- pydantic-v1
3738
- pydantic-v2
@@ -71,7 +72,10 @@ jobs:
7172
run: uv pip install --upgrade "pydantic>=1.10.0,<2.0.0"
7273
- name: Install Pydantic v2
7374
if: matrix.pydantic-version == 'pydantic-v2'
74-
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0" "typing-extensions==4.6.1"
75+
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0"
76+
- name: Pin typing-extensions for Python 3.7
77+
if: matrix.python-version == '3.7'
78+
run: uv pip install --upgrade "typing-extensions==4.6.1"
7579
- name: Lint
7680
# Do not run on Python 3.7 as mypy behaves differently
7781
if: matrix.python-version != '3.7' && matrix.pydantic-version == 'pydantic-v2'
@@ -97,7 +101,7 @@ jobs:
97101
- uses: actions/checkout@v4
98102
- uses: actions/setup-python@v5
99103
with:
100-
python-version: '3.12'
104+
python-version: '3.13'
101105
- name: Setup uv
102106
uses: astral-sh/setup-uv@v5
103107
with:

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.10",
2727
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: 3.13",
2930
"Topic :: Database",
3031
"Topic :: Database :: Database Engines/Servers",
3132
"Topic :: Internet",

requirements-tests.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ ruff ==0.6.2
88
fastapi >=0.103.2
99
httpx ==0.24.1
1010
# TODO: upgrade when deprecating Python 3.7
11-
dirty-equals ==0.6.0
11+
dirty-equals ==0.6.0; python_version < "3.8"
12+
dirty-equals ==0.9.0; python_version >= "3.8"
1213
jinja2 ==3.1.4
1314
# Pin typing-extensions until Python 3.8 is deprecated or the issue with dirty-equals
1415
# is fixed, maybe fixed after dropping Python 3.7 and upgrading dirty-equals
15-
typing-extensions ==4.6.1
16+
typing-extensions ==4.6.1; python_version < "3.8"
17+
typing-extensions ==4.12.2; python_version >= "3.8"

sqlmodel/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
IncEx: TypeAlias = Union[
9494
Set[int],
9595
Set[str],
96-
Mapping[int, Union["IncEx", Literal[True]]],
97-
Mapping[str, Union["IncEx", Literal[True]]],
96+
Mapping[int, Union["IncEx", bool]],
97+
Mapping[str, Union["IncEx", bool]],
9898
]
9999
OnDeleteType = Literal["CASCADE", "SET NULL", "RESTRICT"]
100100

@@ -479,7 +479,7 @@ def Relationship(
479479
class SQLModelMetaclass(ModelMetaclass, DeclarativeMeta):
480480
__sqlmodel_relationships__: Dict[str, RelationshipInfo]
481481
model_config: SQLModelConfig
482-
model_fields: Dict[str, FieldInfo]
482+
model_fields: Dict[str, FieldInfo] # type: ignore[assignment]
483483
__config__: Type[SQLModelConfig]
484484
__fields__: Dict[str, ModelField] # type: ignore[assignment]
485485

0 commit comments

Comments
 (0)