mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-08-17 03:48:31 +08:00
⬆️ Add support for Python 3.13 (#1289)
This commit is contained in:

committed by
GitHub

parent
bf376f83ca
commit
b1349dae45
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@ -32,6 +32,7 @@ jobs:
|
|||||||
- "3.10"
|
- "3.10"
|
||||||
- "3.11"
|
- "3.11"
|
||||||
- "3.12"
|
- "3.12"
|
||||||
|
- "3.13"
|
||||||
pydantic-version:
|
pydantic-version:
|
||||||
- pydantic-v1
|
- pydantic-v1
|
||||||
- pydantic-v2
|
- pydantic-v2
|
||||||
@ -71,7 +72,10 @@ jobs:
|
|||||||
run: uv pip install --upgrade "pydantic>=1.10.0,<2.0.0"
|
run: uv pip install --upgrade "pydantic>=1.10.0,<2.0.0"
|
||||||
- name: Install Pydantic v2
|
- name: Install Pydantic v2
|
||||||
if: matrix.pydantic-version == 'pydantic-v2'
|
if: matrix.pydantic-version == 'pydantic-v2'
|
||||||
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0" "typing-extensions==4.6.1"
|
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0"
|
||||||
|
- name: Pin typing-extensions for Python 3.7
|
||||||
|
if: matrix.python-version == '3.7'
|
||||||
|
run: uv pip install --upgrade "typing-extensions==4.6.1"
|
||||||
- name: Lint
|
- name: Lint
|
||||||
# Do not run on Python 3.7 as mypy behaves differently
|
# Do not run on Python 3.7 as mypy behaves differently
|
||||||
if: matrix.python-version != '3.7' && matrix.pydantic-version == 'pydantic-v2'
|
if: matrix.python-version != '3.7' && matrix.pydantic-version == 'pydantic-v2'
|
||||||
@ -97,7 +101,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.12'
|
python-version: '3.13'
|
||||||
- name: Setup uv
|
- name: Setup uv
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v5
|
||||||
with:
|
with:
|
||||||
|
@ -26,6 +26,7 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Programming Language :: Python :: 3.13",
|
||||||
"Topic :: Database",
|
"Topic :: Database",
|
||||||
"Topic :: Database :: Database Engines/Servers",
|
"Topic :: Database :: Database Engines/Servers",
|
||||||
"Topic :: Internet",
|
"Topic :: Internet",
|
||||||
|
@ -8,8 +8,10 @@ ruff ==0.6.2
|
|||||||
fastapi >=0.103.2
|
fastapi >=0.103.2
|
||||||
httpx ==0.24.1
|
httpx ==0.24.1
|
||||||
# TODO: upgrade when deprecating Python 3.7
|
# TODO: upgrade when deprecating Python 3.7
|
||||||
dirty-equals ==0.6.0
|
dirty-equals ==0.6.0; python_version < "3.8"
|
||||||
|
dirty-equals ==0.9.0; python_version >= "3.8"
|
||||||
jinja2 ==3.1.4
|
jinja2 ==3.1.4
|
||||||
# Pin typing-extensions until Python 3.8 is deprecated or the issue with dirty-equals
|
# Pin typing-extensions until Python 3.8 is deprecated or the issue with dirty-equals
|
||||||
# is fixed, maybe fixed after dropping Python 3.7 and upgrading dirty-equals
|
# is fixed, maybe fixed after dropping Python 3.7 and upgrading dirty-equals
|
||||||
typing-extensions ==4.6.1
|
typing-extensions ==4.6.1; python_version < "3.8"
|
||||||
|
typing-extensions ==4.12.2; python_version >= "3.8"
|
||||||
|
@ -93,8 +93,8 @@ NoArgAnyCallable = Callable[[], Any]
|
|||||||
IncEx: TypeAlias = Union[
|
IncEx: TypeAlias = Union[
|
||||||
Set[int],
|
Set[int],
|
||||||
Set[str],
|
Set[str],
|
||||||
Mapping[int, Union["IncEx", Literal[True]]],
|
Mapping[int, Union["IncEx", bool]],
|
||||||
Mapping[str, Union["IncEx", Literal[True]]],
|
Mapping[str, Union["IncEx", bool]],
|
||||||
]
|
]
|
||||||
OnDeleteType = Literal["CASCADE", "SET NULL", "RESTRICT"]
|
OnDeleteType = Literal["CASCADE", "SET NULL", "RESTRICT"]
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ def Relationship(
|
|||||||
class SQLModelMetaclass(ModelMetaclass, DeclarativeMeta):
|
class SQLModelMetaclass(ModelMetaclass, DeclarativeMeta):
|
||||||
__sqlmodel_relationships__: Dict[str, RelationshipInfo]
|
__sqlmodel_relationships__: Dict[str, RelationshipInfo]
|
||||||
model_config: SQLModelConfig
|
model_config: SQLModelConfig
|
||||||
model_fields: Dict[str, FieldInfo]
|
model_fields: Dict[str, FieldInfo] # type: ignore[assignment]
|
||||||
__config__: Type[SQLModelConfig]
|
__config__: Type[SQLModelConfig]
|
||||||
__fields__: Dict[str, ModelField] # type: ignore[assignment]
|
__fields__: Dict[str, ModelField] # type: ignore[assignment]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user