Skip to content

Commit 9b1c67e

Browse files
authored
Merge branch 'main' into ami/pydantic-jsonb
2 parents dc745c0 + 530c268 commit 9b1c67e

20 files changed

Lines changed: 578 additions & 349 deletions

.github/workflows/build-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v6
2222
# For pull requests it's not necessary to checkout the code but for the main branch it is
23-
- uses: dorny/paths-filter@v3
23+
- uses: dorny/paths-filter@v4
2424
id: filter
2525
with:
2626
filters: |
@@ -66,7 +66,7 @@ jobs:
6666
path: .cache
6767
- name: Build Docs
6868
run: uv run ./scripts/docs.py build
69-
- uses: actions/upload-artifact@v6
69+
- uses: actions/upload-artifact@v7
7070
with:
7171
name: docs-site
7272
path: ./site/**

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
rm -rf ./site
4747
mkdir ./site
48-
- uses: actions/download-artifact@v7
48+
- uses: actions/download-artifact@v8
4949
with:
5050
path: ./site/
5151
pattern: docs-site

.github/workflows/smokeshow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
pyproject.toml
2424
uv.lock
2525
- run: uv sync --locked --no-dev --group github-actions
26-
- uses: actions/download-artifact@v7
26+
- uses: actions/download-artifact@v8
2727
with:
2828
name: coverage-html
2929
path: htmlcov

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
7979
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
8080
- name: Store coverage files
81-
uses: actions/upload-artifact@v6
81+
uses: actions/upload-artifact@v7
8282
with:
8383
name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
8484
path: coverage
@@ -101,7 +101,7 @@ jobs:
101101
pyproject.toml
102102
uv.lock
103103
- name: Get coverage files
104-
uses: actions/download-artifact@v7
104+
uses: actions/download-artifact@v8
105105
with:
106106
pattern: coverage-*
107107
path: coverage
@@ -112,7 +112,7 @@ jobs:
112112
- run: uv run coverage combine coverage
113113
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
114114
- name: Store coverage HTML
115-
uses: actions/upload-artifact@v6
115+
uses: actions/upload-artifact@v7
116116
with:
117117
name: coverage-html
118118
path: htmlcov

docs/css/custom.css

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,70 @@
2727
display: none;
2828
}
2929

30-
a.external-link::after {
31-
/* \00A0 is a non-breaking space
32-
to make the mark be on the same line as the link
33-
*/
34-
content: "\00A0[↪]";
35-
}
36-
37-
a.internal-link::after {
38-
/* \00A0 is a non-breaking space
39-
to make the mark be on the same line as the link
40-
*/
41-
content: "\00A0↪";
30+
/* External links: detected by JS comparing origin to site origin
31+
JS sets data-external-link on links pointing outside the site
32+
Skip image links, .no-link-icon, and .announce-link */
33+
a[data-external-link]:not(:has(img)):not(.no-link-icon):not(.announce-link) {
34+
/* For right to left languages */
35+
direction: ltr;
36+
display: inline-block;
37+
}
38+
39+
a[data-external-link]:not(:has(img)):not(.no-link-icon):not(.announce-link)::after {
40+
content: "";
41+
display: inline-block;
42+
width: 0.75em;
43+
height: 0.75em;
44+
margin-left: 0.25em;
45+
vertical-align: middle;
46+
opacity: 0.55;
47+
background: currentColor;
48+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
49+
-webkit-mask-size: contain;
50+
-webkit-mask-repeat: no-repeat;
51+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
52+
mask-size: contain;
53+
mask-repeat: no-repeat;
54+
}
55+
56+
a[data-external-link]:not(:has(img)):not(.no-link-icon):not(.announce-link):hover::after {
57+
opacity: 0.85;
58+
}
59+
60+
/* Internal links opening in new tab: same-origin links with target=_blank
61+
JS sets data-internal-link on links pointing to the same site origin
62+
Skip image links, .no-link-icon, and .announce-link */
63+
a[data-internal-link][target="_blank"]:not(:has(img)):not(.no-link-icon):not(.announce-link) {
64+
/* For right to left languages */
65+
direction: ltr;
66+
display: inline-block;
67+
}
68+
69+
a[data-internal-link][target="_blank"]:not(:has(img)):not(.no-link-icon):not(.announce-link)::after {
70+
content: "";
71+
display: inline-block;
72+
width: 0.75em;
73+
height: 0.75em;
74+
margin-left: 0.25em;
75+
vertical-align: middle;
76+
opacity: 0.55;
77+
background: currentColor;
78+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='14' height='14' rx='2'/%3E%3Cpath d='M7 3h14v14'/%3E%3C/svg%3E");
79+
-webkit-mask-size: contain;
80+
-webkit-mask-repeat: no-repeat;
81+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='14' height='14' rx='2'/%3E%3Cpath d='M7 3h14v14'/%3E%3C/svg%3E");
82+
mask-size: contain;
83+
mask-repeat: no-repeat;
84+
}
85+
86+
a[data-internal-link][target="_blank"]:not(:has(img)):not(.no-link-icon):not(.announce-link):hover::after {
87+
opacity: 0.85;
88+
}
89+
90+
/* Disable link icons in footer and header nav */
91+
.md-footer a::after,
92+
.md-header a::after {
93+
content: none !important;
4294
}
4395

4496
.shadow {

docs/js/custom.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,36 @@ function setupTermynal() {
109109
loadVisibleTermynals();
110110
}
111111

112+
function openLinksInNewTab() {
113+
const siteUrl = document.querySelector("link[rel='canonical']")?.href
114+
|| window.location.origin;
115+
const siteOrigin = new URL(siteUrl).origin;
116+
document.querySelectorAll(".md-content a[href]").forEach(a => {
117+
if (a.getAttribute("target") === "_self") return;
118+
const href = a.getAttribute("href");
119+
if (!href) return;
120+
try {
121+
const url = new URL(href, window.location.href);
122+
// Skip same-page anchor links (only the hash differs)
123+
if (url.origin === window.location.origin
124+
&& url.pathname === window.location.pathname
125+
&& url.search === window.location.search) return;
126+
if (!a.hasAttribute("target")) {
127+
a.setAttribute("target", "_blank");
128+
a.setAttribute("rel", "noopener");
129+
}
130+
if (url.origin !== siteOrigin) {
131+
a.dataset.externalLink = "";
132+
} else {
133+
a.dataset.internalLink = "";
134+
}
135+
} catch (_) {}
136+
});
137+
}
138+
112139
async function main() {
113-
setupTermynal()
140+
setupTermynal();
141+
openLinksInNewTab();
114142
}
115143

116144
document$.subscribe(() => {

docs/release-notes.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,47 @@
22

33
## Latest Changes
44

5+
### Fixes
6+
7+
* 🐛 Fix `tuple_` return type annotation. PR [#1639](https://github.com/fastapi/sqlmodel/pull/1639) by [@kakeruzoku](https://github.com/kakeruzoku).
8+
9+
### Docs
10+
11+
* 📝 Fix ambiguous phrasing regarding `HeroPublicWithTeam` model. PR [#1678](https://github.com/fastapi/sqlmodel/pull/1678) by [@berkaykrc](https://github.com/berkaykrc).
12+
* 🔨 Handle external links `target=_blank` and CSS automatically in JS and CSS. PR [#1799](https://github.com/fastapi/sqlmodel/pull/1799) by [@tiangolo](https://github.com/tiangolo).
13+
* 📝 Document `.in_()` method. PR [#619](https://github.com/fastapi/sqlmodel/pull/619) by [@masylum](https://github.com/masylum).
14+
* 📝 Fix small typos in the documentation. PR [#1641](https://github.com/fastapi/sqlmodel/pull/1641) by [@svlandeg](https://github.com/svlandeg).
15+
516
### Internal
617

18+
* ⬆ Bump prek from 0.3.5 to 0.3.6. PR [#1817](https://github.com/fastapi/sqlmodel/pull/1817) by [@dependabot[bot]](https://github.com/apps/dependabot).
19+
* 📌 Update internal dependency limits. PR [#1809](https://github.com/fastapi/sqlmodel/pull/1809) by [@svlandeg](https://github.com/svlandeg).
20+
* ⬆ Bump ruff from 0.15.5 to 0.15.6. PR [#1814](https://github.com/fastapi/sqlmodel/pull/1814) by [@dependabot[bot]](https://github.com/apps/dependabot).
21+
* ⬆ Bump cairosvg from 2.8.2 to 2.9.0. PR [#1813](https://github.com/fastapi/sqlmodel/pull/1813) by [@dependabot[bot]](https://github.com/apps/dependabot).
22+
* ⬆ Bump dorny/paths-filter from 3 to 4. PR [#1812](https://github.com/fastapi/sqlmodel/pull/1812) by [@dependabot[bot]](https://github.com/apps/dependabot).
23+
* ⬆ Bump black from 26.3.0 to 26.3.1. PR [#1811](https://github.com/fastapi/sqlmodel/pull/1811) by [@dependabot[bot]](https://github.com/apps/dependabot).
24+
* ⬆ Bump mkdocs-material from 9.7.4 to 9.7.5. PR [#1808](https://github.com/fastapi/sqlmodel/pull/1808) by [@dependabot[bot]](https://github.com/apps/dependabot).
25+
* ⬆ Bump prek from 0.3.4 to 0.3.5. PR [#1807](https://github.com/fastapi/sqlmodel/pull/1807) by [@dependabot[bot]](https://github.com/apps/dependabot).
26+
* ⬆ Bump black from 26.1.0 to 26.3.0. PR [#1803](https://github.com/fastapi/sqlmodel/pull/1803) by [@dependabot[bot]](https://github.com/apps/dependabot).
27+
* ⬆ Bump ruff from 0.15.4 to 0.15.5. PR [#1801](https://github.com/fastapi/sqlmodel/pull/1801) by [@dependabot[bot]](https://github.com/apps/dependabot).
28+
* ⬆ Bump mkdocs-material from 9.7.3 to 9.7.4. PR [#1797](https://github.com/fastapi/sqlmodel/pull/1797) by [@dependabot[bot]](https://github.com/apps/dependabot).
29+
* ⬆ Bump sqlalchemy from 2.0.47 to 2.0.48. PR [#1793](https://github.com/fastapi/sqlmodel/pull/1793) by [@dependabot[bot]](https://github.com/apps/dependabot).
30+
* ⬆ Bump prek from 0.3.3 to 0.3.4. PR [#1794](https://github.com/fastapi/sqlmodel/pull/1794) by [@dependabot[bot]](https://github.com/apps/dependabot).
31+
* ⬆ Bump fastapi from 0.134.0 to 0.135.1. PR [#1795](https://github.com/fastapi/sqlmodel/pull/1795) by [@dependabot[bot]](https://github.com/apps/dependabot).
32+
* ⬆ Bump fastapi from 0.133.1 to 0.134.0. PR [#1792](https://github.com/fastapi/sqlmodel/pull/1792) by [@dependabot[bot]](https://github.com/apps/dependabot).
33+
* ⬆ Bump ruff from 0.15.2 to 0.15.4. PR [#1790](https://github.com/fastapi/sqlmodel/pull/1790) by [@dependabot[bot]](https://github.com/apps/dependabot).
34+
* ⬆ Bump actions/download-artifact from 7 to 8. PR [#1789](https://github.com/fastapi/sqlmodel/pull/1789) by [@dependabot[bot]](https://github.com/apps/dependabot).
35+
* ⬆ Bump actions/upload-artifact from 6 to 7. PR [#1788](https://github.com/fastapi/sqlmodel/pull/1788) by [@dependabot[bot]](https://github.com/apps/dependabot).
36+
* ⬆ Bump fastapi from 0.133.0 to 0.133.1. PR [#1787](https://github.com/fastapi/sqlmodel/pull/1787) by [@dependabot[bot]](https://github.com/apps/dependabot).
37+
* ⬆ Bump mkdocs-material from 9.7.2 to 9.7.3. PR [#1782](https://github.com/fastapi/sqlmodel/pull/1782) by [@dependabot[bot]](https://github.com/apps/dependabot).
38+
* ⬆ Bump fastapi from 0.132.0 to 0.133.0. PR [#1781](https://github.com/fastapi/sqlmodel/pull/1781) by [@dependabot[bot]](https://github.com/apps/dependabot).
39+
* ⬆ Bump sqlalchemy from 2.0.46 to 2.0.47. PR [#1783](https://github.com/fastapi/sqlmodel/pull/1783) by [@dependabot[bot]](https://github.com/apps/dependabot).
40+
* ⬆ Bump pytest from 8.4.2 to 9.0.2. PR [#1780](https://github.com/fastapi/sqlmodel/pull/1780) by [@dependabot[bot]](https://github.com/apps/dependabot).
41+
* ⬆ Bump mkdocstrings[python] from 0.30.1 to 1.0.3. PR [#1776](https://github.com/fastapi/sqlmodel/pull/1776) by [@dependabot[bot]](https://github.com/apps/dependabot).
42+
* ⬆ Bump typer from 0.23.2 to 0.24.1. PR [#1777](https://github.com/fastapi/sqlmodel/pull/1777) by [@dependabot[bot]](https://github.com/apps/dependabot).
43+
* ⬆ Bump ruff from 0.15.1 to 0.15.2. PR [#1779](https://github.com/fastapi/sqlmodel/pull/1779) by [@dependabot[bot]](https://github.com/apps/dependabot).
44+
* ⬆ Bump fastapi from 0.129.0 to 0.132.0. PR [#1778](https://github.com/fastapi/sqlmodel/pull/1778) by [@dependabot[bot]](https://github.com/apps/dependabot).
45+
* ⬆ Update all dependencies to use `griffelib` instead of `griffe`. PR [#1775](https://github.com/fastapi/sqlmodel/pull/1775) by [@svlandeg](https://github.com/svlandeg).
746
* ⬆ Bump mkdocs-material from 9.7.1 to 9.7.2. PR [#1764](https://github.com/fastapi/sqlmodel/pull/1764) by [@dependabot[bot]](https://github.com/apps/dependabot).
847
* ⬆ Bump pillow from 11.3.0 to 12.1.1. PR [#1770](https://github.com/fastapi/sqlmodel/pull/1770) by [@dependabot[bot]](https://github.com/apps/dependabot).
948
* ⬆ Bump pydantic-settings from 2.12.0 to 2.13.1. PR [#1771](https://github.com/fastapi/sqlmodel/pull/1771) by [@dependabot[bot]](https://github.com/apps/dependabot).

docs/tutorial/code-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Hero's team: name='Z-Force' headquarters='Sister Margaret's Bar' id=1
139139

140140
## Make Circular Imports Work
141141

142-
Let's say that for some reason you hate the idea of having all the database models together in a single file, and you really want to have **separate files** a `hero_model.py` file and a `team_model.py` file.
142+
Let's say that for some reason you hate the idea of having all the database models together in a single file, and you really want to have **separate files**: a `hero_model.py` file and a `team_model.py` file.
143143

144144
You can also do it. 😎 There's a couple of things to keep in mind. 🤓
145145

docs/tutorial/connect/read-connected-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ And as we used `select` with two models, we will receive tuples of instances of
129129

130130
{* ./docs_src/tutorial/connect/select/tutorial001_py310.py ln[61:66] hl[65] *}
131131

132-
For each iteration in the `for` loop we get a a tuple with an instance of the class `Hero` and an instance of the class `Team`.
132+
For each iteration in the `for` loop we get a tuple with an instance of the class `Hero` and an instance of the class `Team`.
133133

134134
And in this `for` loop we assign them to the variable `hero` and the variable `team`.
135135

docs/tutorial/create-db-and-table.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ But you will learn about migrations later in the Advanced User Guide.
321321

322322
Let's run the program to see it all working.
323323

324-
Put the code it in a file `app.py` if you haven't already.
324+
Put the code in a file `app.py` if you haven't already.
325325

326326
{* ./docs_src/tutorial/create_db_and_table/tutorial001_py310.py *}
327327

0 commit comments

Comments
 (0)