Skip to content

Commit 778f887

Browse files
authored
Merge branch 'main' into feat/py314
2 parents 8da8991 + 5644ab4 commit 778f887

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

docs/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
### Internal
1414

15+
* ⬆ Bump mypy from 1.4.1 to 1.18.2. PR [#1560](https://github.com/fastapi/sqlmodel/pull/1560) by [@dependabot[bot]](https://github.com/apps/dependabot).
1516
* ✅ Add test that runs select with 3 or 4 arguments. PR [#1590](https://github.com/fastapi/sqlmodel/pull/1590) by [@svlandeg](https://github.com/svlandeg).
1617
* ⬆ Bump mkdocs-macros-plugin from 1.3.9 to 1.4.0. PR [#1581](https://github.com/fastapi/sqlmodel/pull/1581) by [@dependabot[bot]](https://github.com/apps/dependabot).
1718
* ⬆ Bump mkdocs-material from 9.6.20 to 9.6.21. PR [#1588](https://github.com/fastapi/sqlmodel/pull/1588) by [@dependabot[bot]](https://github.com/apps/dependabot).

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ show_contexts = true
9999

100100
[tool.mypy]
101101
strict = true
102-
103-
[[tool.mypy.overrides]]
104-
module = "sqlmodel.sql._expression_select_gen"
105-
warn_unused_ignores = false
102+
exclude = "sqlmodel.sql._expression_select_gen"
106103

107104
[[tool.mypy.overrides]]
108105
module = "docs_src.*"

requirements-tests.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
-r requirements-docs-tests.txt
33
pytest >=7.0.1,<9.0.0
44
coverage[toml] >=6.2,<8.0
5-
mypy ==1.4.1
5+
# Remove when support for Python 3.8 is dropped
6+
mypy ==1.14.1; python_version < "3.9"
7+
mypy ==1.18.2; python_version >= "3.9"
68
ruff ==0.13.2
79
# For FastAPI tests
810
fastapi >=0.103.2

sqlmodel/_compat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def init_pydantic_private_attrs(new_object: InstanceOrType["SQLModel"]) -> None:
123123
object.__setattr__(new_object, "__pydantic_private__", None)
124124

125125
def get_annotations(class_dict: Dict[str, Any]) -> Dict[str, Any]:
126-
return class_dict.get("__annotations__", {})
126+
return class_dict.get("__annotations__", {}) # type: ignore[no-any-return]
127127

128128
def is_table_model_class(cls: Type[Any]) -> bool:
129129
config = getattr(cls, "model_config", {})
@@ -180,7 +180,7 @@ def is_field_noneable(field: "FieldInfo") -> bool:
180180
if not field.is_required():
181181
if field.default is Undefined:
182182
return False
183-
if field.annotation is None or field.annotation is NoneType: # type: ignore[comparison-overlap]
183+
if field.annotation is None or field.annotation is NoneType:
184184
return True
185185
return False
186186
return False
@@ -509,7 +509,7 @@ def _calculate_keys(
509509
keys -= update.keys()
510510

511511
if exclude:
512-
keys -= {k for k, v in exclude.items() if ValueItems.is_true(v)}
512+
keys -= {str(k) for k, v in exclude.items() if ValueItems.is_true(v)}
513513

514514
return keys
515515

sqlmodel/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import ipaddress
24
import uuid
35
import weakref
@@ -601,7 +603,7 @@ def __init__(
601603
setattr(cls, rel_name, rel_info.sa_relationship) # Fix #315
602604
continue
603605
raw_ann = cls.__annotations__[rel_name]
604-
origin = get_origin(raw_ann)
606+
origin: Any = get_origin(raw_ann)
605607
if origin is Mapped:
606608
ann = raw_ann.__args__[0]
607609
else:

0 commit comments

Comments
 (0)