Skip to content

Commit a96ba70

Browse files
authored
Merge branch 'main' into patch-1
2 parents 95d1130 + 92e7bdb commit a96ba70

34 files changed

+126
-331
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.11.8
17+
rev: v0.12.3
1818
hooks:
1919
- id: ruff
2020
args:

docs/release-notes.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919

2020
### Internal
2121

22+
*[pre-commit.ci] pre-commit autoupdate. PR [#1428](https://github.com/fastapi/sqlmodel/pull/1428) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
23+
* ⬆ Bump ruff from 0.12.2 to 0.12.3. PR [#1432](https://github.com/fastapi/sqlmodel/pull/1432) by [@dependabot[bot]](https://github.com/apps/dependabot).
24+
*[pre-commit.ci] pre-commit autoupdate. PR [#1418](https://github.com/fastapi/sqlmodel/pull/1418) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
25+
* ⬆ Bump pillow from 11.2.1 to 11.3.0. PR [#1423](https://github.com/fastapi/sqlmodel/pull/1423) by [@dependabot[bot]](https://github.com/apps/dependabot).
26+
* ⬆ Bump mkdocs-material from 9.6.14 to 9.6.15. PR [#1424](https://github.com/fastapi/sqlmodel/pull/1424) by [@dependabot[bot]](https://github.com/apps/dependabot).
27+
* ⬆ Bump ruff from 0.12.0 to 0.12.2. PR [#1425](https://github.com/fastapi/sqlmodel/pull/1425) by [@dependabot[bot]](https://github.com/apps/dependabot).
28+
*[pre-commit.ci] pre-commit autoupdate. PR [#1374](https://github.com/fastapi/sqlmodel/pull/1374) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
29+
* ⬆ Bump ruff from 0.11.13 to 0.12.0. PR [#1403](https://github.com/fastapi/sqlmodel/pull/1403) by [@dependabot[bot]](https://github.com/apps/dependabot).
30+
* ✅ Simplify tests for `tests/test_tutorial/test_code_structure/test_tutorial001.py`, one test file for multiple variants. PR [#1408](https://github.com/fastapi/sqlmodel/pull/1408) by [@tiangolo](https://github.com/tiangolo).
31+
* ✅ Simplify tests setup, one test file for multiple source variants. PR [#1407](https://github.com/fastapi/sqlmodel/pull/1407) by [@tiangolo](https://github.com/tiangolo).
32+
* ✅ Refactor tests to use autouse `clear_sqlmodel`. PR [#1406](https://github.com/fastapi/sqlmodel/pull/1406) by [@tiangolo](https://github.com/tiangolo).
33+
* ⬆ Bump mkdocs-material from 9.5.18 to 9.6.14. PR [#1378](https://github.com/fastapi/sqlmodel/pull/1378) by [@dependabot[bot]](https://github.com/apps/dependabot).
34+
* ⬆ Bump typer from 0.15.3 to 0.16.0. PR [#1393](https://github.com/fastapi/sqlmodel/pull/1393) by [@dependabot[bot]](https://github.com/apps/dependabot).
35+
* ⬆ Bump cairosvg from 2.7.1 to 2.8.2. PR [#1383](https://github.com/fastapi/sqlmodel/pull/1383) by [@dependabot[bot]](https://github.com/apps/dependabot).
36+
* ⬆ Bump ruff from 0.11.7 to 0.11.13. PR [#1397](https://github.com/fastapi/sqlmodel/pull/1397) by [@dependabot[bot]](https://github.com/apps/dependabot).
37+
* 🔧 Remove Google Analytics. PR [#1386](https://github.com/fastapi/sqlmodel/pull/1386) by [@tiangolo](https://github.com/tiangolo).
2238
* ⬆ Bump mkdocs-macros-plugin from 1.0.5 to 1.3.7. PR [#1354](https://github.com/fastapi/sqlmodel/pull/1354) by [@dependabot[bot]](https://github.com/apps/dependabot).
2339
* ⬆ Bump griffe-typingdoc from 0.2.5 to 0.2.8. PR [#1359](https://github.com/fastapi/sqlmodel/pull/1359) by [@dependabot[bot]](https://github.com/apps/dependabot).
2440
* ⬆ Update pre-commit requirement from <4.0.0,>=2.17.0 to >=2.17.0,<5.0.0. PR [#1360](https://github.com/fastapi/sqlmodel/pull/1360) by [@dependabot[bot]](https://github.com/apps/dependabot).

mkdocs.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,6 @@ markdown_extensions:
187187
markdown_include_variants:
188188

189189
extra:
190-
analytics:
191-
provider: google
192-
property: G-J8HVTT936W
193-
feedback:
194-
title: Was this page helpful?
195-
ratings:
196-
- icon: material/emoticon-happy-outline
197-
name: This page was helpful
198-
data: 1
199-
note: >-
200-
Thanks for your feedback!
201-
- icon: material/emoticon-sad-outline
202-
name: This page could be improved
203-
data: 0
204-
note: >-
205-
Thanks for your feedback!
206190
social:
207191
- icon: fontawesome/brands/github-alt
208192
link: https://github.com/fastapi/sqlmodel

requirements-docs.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
-e .
22
-r requirements-docs-tests.txt
3-
mkdocs-material==9.5.18
3+
mkdocs-material==9.6.15
44
mdx-include >=1.4.1,<2.0.0
55
mkdocs-redirects>=1.2.1,<1.3.0
66
pyyaml >=5.3.1,<7.0.0
77
# For Material for MkDocs, Chinese search
88
# jieba==0.42.1
99
# For image processing by Material for MkDocs
10-
pillow==11.2.1
10+
pillow==11.3.0
1111
# For image processing by Material for MkDocs
12-
cairosvg==2.7.1
12+
cairosvg==2.8.2
1313
# mkdocstrings[python]==0.25.1
1414
griffe-typingdoc==0.2.8
1515
# For griffe, it formats with black
16-
typer == 0.15.3
16+
typer == 0.16.0
1717
mkdocs-macros-plugin==1.3.7
1818
markdown-include-variants==0.0.4

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pytest >=7.0.1,<9.0.0
44
coverage[toml] >=6.2,<8.0
55
mypy ==1.4.1
6-
ruff ==0.11.7
6+
ruff ==0.12.3
77
# For FastAPI tests
88
fastapi >=0.103.2
99
httpx ==0.28.1

tests/conftest.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import shutil
22
import subprocess
33
import sys
4+
from dataclasses import dataclass, field
45
from pathlib import Path
5-
from typing import Any, Callable, Dict, List, Union
6+
from typing import Any, Callable, Dict, Generator, List, Union
7+
from unittest.mock import patch
68

79
import pytest
810
from pydantic import BaseModel
@@ -14,8 +16,8 @@
1416
docs_src_path = top_level_path / "docs_src"
1517

1618

17-
@pytest.fixture()
18-
def clear_sqlmodel():
19+
@pytest.fixture(autouse=True)
20+
def clear_sqlmodel() -> Any:
1921
# Clear the tables in the metadata for the default base model
2022
SQLModel.metadata.clear()
2123
# Clear the Models associated with the registry, to avoid warnings
@@ -26,7 +28,7 @@ def clear_sqlmodel():
2628

2729

2830
@pytest.fixture()
29-
def cov_tmp_path(tmp_path: Path):
31+
def cov_tmp_path(tmp_path: Path) -> Generator[Path, None, None]:
3032
yield tmp_path
3133
for coverage_path in tmp_path.glob(".coverage*"):
3234
coverage_destiny_path = top_level_path / coverage_path.name
@@ -53,8 +55,8 @@ def coverage_run(*, module: str, cwd: Union[str, Path]) -> subprocess.CompletedP
5355
def get_testing_print_function(
5456
calls: List[List[Union[str, Dict[str, Any]]]],
5557
) -> Callable[..., Any]:
56-
def new_print(*args):
57-
data = []
58+
def new_print(*args: Any) -> None:
59+
data: List[Any] = []
5860
for arg in args:
5961
if isinstance(arg, BaseModel):
6062
data.append(arg.model_dump())
@@ -71,6 +73,19 @@ def new_print(*args):
7173
return new_print
7274

7375

76+
@dataclass
77+
class PrintMock:
78+
calls: List[Any] = field(default_factory=list)
79+
80+
81+
@pytest.fixture(name="print_mock")
82+
def print_mock_fixture() -> Generator[PrintMock, None, None]:
83+
print_mock = PrintMock()
84+
new_print = get_testing_print_function(print_mock.calls)
85+
with patch("builtins.print", new=new_print):
86+
yield print_mock
87+
88+
7489
needs_pydanticv2 = pytest.mark.skipif(not IS_PYDANTIC_V2, reason="requires Pydantic v2")
7590
needs_pydanticv1 = pytest.mark.skipif(IS_PYDANTIC_V2, reason="requires Pydantic v1")
7691

tests/test_advanced/test_decimal/test_tutorial001.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
]
3131

3232

33-
def test_tutorial(clear_sqlmodel):
33+
def test_tutorial():
3434
from docs_src.advanced.decimal import tutorial001 as mod
3535

3636
mod.sqlite_url = "sqlite://"

tests/test_advanced/test_decimal/test_tutorial001_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232

3333
@needs_py310
34-
def test_tutorial(clear_sqlmodel):
34+
def test_tutorial():
3535
from docs_src.advanced.decimal import tutorial001_py310 as mod
3636

3737
mod.sqlite_url = "sqlite://"

tests/test_advanced/test_uuid/test_tutorial001.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from ...conftest import get_testing_print_function
77

88

9-
def test_tutorial(clear_sqlmodel) -> None:
9+
def test_tutorial() -> None:
1010
from docs_src.advanced.uuid import tutorial001 as mod
1111

1212
mod.sqlite_url = "sqlite://"

tests/test_advanced/test_uuid/test_tutorial001_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
@needs_py310
10-
def test_tutorial(clear_sqlmodel) -> None:
10+
def test_tutorial() -> None:
1111
from docs_src.advanced.uuid import tutorial001_py310 as mod
1212

1313
mod.sqlite_url = "sqlite://"

0 commit comments

Comments
 (0)