Skip to content

Commit 20964c8

Browse files
Merge branch 'main' into allow-dict-relationship
2 parents 1bf3b91 + 37ae239 commit 20964c8

File tree

252 files changed

+1743
-9354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+1743
-9354
lines changed

.github/labeler.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ internal:
1616
- scripts/**
1717
- .gitignore
1818
- .pre-commit-config.yaml
19-
- pdm_build.py
2019
- requirements*.txt
2120
- uv.lock
2221
- all-globs-to-all-files:

.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/publish.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ on:
1414
jobs:
1515
publish:
1616
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
package:
20-
- sqlmodel
21-
- sqlmodel-slim
2217
permissions:
2318
id-token: write
2419
contents: read
@@ -36,7 +31,5 @@ jobs:
3631
uses: astral-sh/setup-uv@v7
3732
- name: Build distribution
3833
run: uv build
39-
env:
40-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
4134
- name: Publish
4235
run: uv publish

.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: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,29 @@ jobs:
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
2929
python-version: [ "3.14" ]
30+
uv-resolution:
31+
- highest
3032
include:
31-
- os: windows-latest
32-
python-version: "3.9"
3333
- os: ubuntu-latest
3434
python-version: "3.10"
35+
uv-resolution: lowest-direct
3536
- os: macos-latest
3637
python-version: "3.11"
38+
uv-resolution: highest
3739
- os: windows-latest
3840
python-version: "3.12"
41+
uv-resolution: lowest-direct
3942
- os: ubuntu-latest
4043
python-version: "3.13"
44+
uv-resolution: highest
4145
- os: macos-latest
4246
python-version: "3.13"
47+
uv-resolution: highest
4348
fail-fast: false
4449
runs-on: ${{ matrix.os }}
4550
env:
4651
UV_PYTHON: ${{ matrix.python-version }}
52+
UV_RESOLUTION: ${{ matrix.uv-resolution }}
4753
steps:
4854
- uses: actions/checkout@v6
4955
- name: Set up Python
@@ -64,15 +70,15 @@ jobs:
6470
with:
6571
limit-access-to-actor: true
6672
- name: Install Dependencies
67-
run: uv sync --locked --no-dev --group tests
73+
run: uv sync --no-dev --group tests
6874
- run: mkdir coverage
6975
- name: Test
7076
run: uv run bash scripts/test.sh
7177
env:
7278
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
7379
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
7480
- name: Store coverage files
75-
uses: actions/upload-artifact@v6
81+
uses: actions/upload-artifact@v7
7682
with:
7783
name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
7884
path: coverage
@@ -95,7 +101,7 @@ jobs:
95101
pyproject.toml
96102
uv.lock
97103
- name: Get coverage files
98-
uses: actions/download-artifact@v7
104+
uses: actions/download-artifact@v8
99105
with:
100106
pattern: coverage-*
101107
path: coverage
@@ -106,7 +112,7 @@ jobs:
106112
- run: uv run coverage combine coverage
107113
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
108114
- name: Store coverage HTML
109-
uses: actions/upload-artifact@v6
115+
uses: actions/upload-artifact@v7
110116
with:
111117
name: coverage-html
112118
path: htmlcov

.pre-commit-config.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ repos:
2828
language: unsupported
2929
types: [python]
3030

31-
- id: local-mypy
32-
name: mypy check
33-
entry: uv run mypy sqlmodel tests/test_select_typing.py
31+
- id: local-ty
32+
name: ty check
33+
entry: uv run ty check sqlmodel tests/test_select_typing.py
3434
require_serial: true
3535
language: unsupported
3636
pass_filenames: false
@@ -41,6 +41,13 @@ repos:
4141
entry: uv run ./scripts/generate_select.py
4242
files: ^scripts/generate_select\.py|sqlmodel/sql/_expression_select_gen\.py\.jinja2$
4343

44+
- id: add-release-date
45+
language: unsupported
46+
name: add date to latest release header
47+
entry: uv run python scripts/add_latest_release_date.py
48+
files: ^docs/release-notes\.md$
49+
pass_filenames: false
50+
4451
- id: generate-readme
4552
language: unsupported
4653
name: generate README.md from index.md

docs/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ That way, you can edit the documentation/source files and see the changes live.
9292

9393
/// tip
9494

95-
Alternatively, you can perform the same steps that scripts does manually.
95+
Alternatively, you can perform the same steps that the script does manually.
9696

97-
Go into the docs director at `docs/`:
97+
Go into the docs directory at `docs/`:
9898

9999
```console
100100
$ cd docs/

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(() => {

0 commit comments

Comments
 (0)