Skip to content

Commit df38aea

Browse files
authored
Merge branch 'main' into ami/pydantic-jsonb
2 parents d9f3f81 + d9849dc commit df38aea

File tree

434 files changed

+6851
-27559
lines changed

Some content is hidden

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

434 files changed

+6851
-27559
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ updates:
88
commit-message:
99
prefix:
1010
# Python
11-
- package-ecosystem: "pip"
11+
- package-ecosystem: "uv"
1212
directory: "/"
1313
schedule:
1414
interval: "daily"

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ internal:
1616
- scripts/**
1717
- .gitignore
1818
- .pre-commit-config.yaml
19-
- pdm_build.py
2019
- requirements*.txt
20+
- uv.lock
2121
- all-globs-to-all-files:
2222
- '!docs/**'
2323
- '!sqlmodel/**'

.github/workflows/build-docs.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ on:
88
- opened
99
- synchronize
1010

11-
env:
12-
UV_SYSTEM_PYTHON: 1
13-
14-
1511
jobs:
1612
changes:
1713
runs-on: ubuntu-latest
@@ -22,7 +18,7 @@ jobs:
2218
outputs:
2319
docs: ${{ steps.filter.outputs.docs }}
2420
steps:
25-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2622
# For pull requests it's not necessary to checkout the code but for the main branch it is
2723
- uses: dorny/paths-filter@v3
2824
id: filter
@@ -32,13 +28,10 @@ jobs:
3228
- README.md
3329
- docs/**
3430
- docs_src/**
35-
- requirements-docs.txt
36-
- requirements-docs-insiders.txt
3731
- pyproject.toml
32+
- uv.lock
3833
- mkdocs.yml
39-
- mkdocs.insiders.yml
40-
- mkdocs.maybe-insiders.yml
41-
- mkdocs.no-insiders.yml
34+
- mkdocs.env.yml
4235
- .github/workflows/build-docs.yml
4336
- .github/workflows/deploy-docs.yml
4437
- data/**
@@ -53,35 +46,27 @@ jobs:
5346
env:
5447
GITHUB_CONTEXT: ${{ toJson(github) }}
5548
run: echo "$GITHUB_CONTEXT"
56-
- uses: actions/checkout@v4
49+
- uses: actions/checkout@v6
5750
- name: Set up Python
58-
uses: actions/setup-python@v5
51+
uses: actions/setup-python@v6
5952
with:
60-
python-version: "3.11"
53+
python-version-file: ".python-version"
6154
- name: Setup uv
62-
uses: astral-sh/setup-uv@v6
55+
uses: astral-sh/setup-uv@v7
6356
with:
64-
version: "0.4.15"
6557
enable-cache: true
6658
cache-dependency-glob: |
67-
requirements**.txt
6859
pyproject.toml
60+
uv.lock
6961
- name: Install docs extras
70-
run: uv pip install -r requirements-docs.txt
71-
- name: Install Material for MkDocs Insiders
72-
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
73-
run: uv pip install -r requirements-docs-insiders.txt
74-
env:
75-
TOKEN: ${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}
76-
- uses: actions/cache@v4
62+
run: uv sync --locked --no-dev --group docs
63+
- uses: actions/cache@v5
7764
with:
7865
key: mkdocs-cards-${{ github.ref }}
7966
path: .cache
80-
- name: Verify README
81-
run: python ./scripts/docs.py verify-readme
8267
- name: Build Docs
83-
run: python ./scripts/docs.py build
84-
- uses: actions/upload-artifact@v4
68+
run: uv run ./scripts/docs.py build
69+
- uses: actions/upload-artifact@v6
8570
with:
8671
name: docs-site
8772
path: ./site/**

.github/workflows/deploy-docs.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ permissions:
1212
pull-requests: write
1313
statuses: write
1414

15-
env:
16-
UV_SYSTEM_PYTHON: 1
17-
1815
jobs:
1916
deploy-docs:
2017
runs-on: ubuntu-latest
@@ -23,33 +20,32 @@ jobs:
2320
env:
2421
GITHUB_CONTEXT: ${{ toJson(github) }}
2522
run: echo "$GITHUB_CONTEXT"
26-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v6
2724
- name: Set up Python
28-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
2926
with:
30-
python-version: "3.11"
27+
python-version-file: ".python-version"
3128
- name: Setup uv
32-
uses: astral-sh/setup-uv@v6
29+
uses: astral-sh/setup-uv@v7
3330
with:
34-
version: "0.4.15"
3531
enable-cache: true
3632
cache-dependency-glob: |
37-
requirements**.txt
3833
pyproject.toml
34+
uv.lock
3935
- name: Install GitHub Actions dependencies
40-
run: uv pip install -r requirements-github-actions.txt
36+
run: uv sync --locked --no-dev --group github-actions
4137
- name: Deploy Docs Status Pending
42-
run: python ./scripts/deploy_docs_status.py
38+
run: uv run ./scripts/deploy_docs_status.py
4339
env:
4440
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4541
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
4642
RUN_ID: ${{ github.run_id }}
47-
43+
STATE: "pending"
4844
- name: Clean site
4945
run: |
5046
rm -rf ./site
5147
mkdir ./site
52-
- uses: actions/download-artifact@v4
48+
- uses: actions/download-artifact@v7
5349
with:
5450
path: ./site/
5551
pattern: docs-site
@@ -68,11 +64,19 @@ jobs:
6864
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
6965
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
7066
command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }}
67+
- name: Deploy Docs Status Error
68+
if: failure()
69+
run: uv run ./scripts/deploy_docs_status.py
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
73+
RUN_ID: ${{ github.run_id }}
74+
STATE: "error"
7175
- name: Comment Deploy
72-
run: python ./scripts/deploy_docs_status.py
76+
run: uv run ./scripts/deploy_docs_status.py
7377
env:
7478
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7579
DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }}
7680
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
7781
RUN_ID: ${{ github.run_id }}
78-
IS_DONE: "true"
82+
STATE: "success"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Conflict detector"
2+
on:
3+
push:
4+
pull_request_target:
5+
types: [synchronize]
6+
7+
jobs:
8+
main:
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check if PRs have merge conflicts
15+
uses: eps1lon/actions-label-merge-conflict@v3
16+
with:
17+
dirtyLabel: "conflicts"
18+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
19+
commentOnDirty: "This pull request has a merge conflict that needs to be resolved."

.github/workflows/issue-manager.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
env:
2828
GITHUB_CONTEXT: ${{ toJson(github) }}
2929
run: echo "$GITHUB_CONTEXT"
30-
- uses: tiangolo/issue-manager@0.5.1
30+
- uses: tiangolo/issue-manager@0.6.0
3131
with:
3232
token: ${{ secrets.GITHUB_TOKEN }}
3333
config: >
@@ -38,10 +38,18 @@ jobs:
3838
},
3939
"waiting": {
4040
"delay": 2628000,
41-
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR."
41+
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR.",
42+
"reminder": {
43+
"before": "P3D",
44+
"message": "Heads-up: this will be closed in 3 days unless there's new activity."
45+
}
4246
},
4347
"invalid": {
4448
"delay": 0,
4549
"message": "This was marked as invalid and will be closed now. If this is an error, please provide additional details."
50+
},
51+
"maybe-ai": {
52+
"delay": 0,
53+
"message": "This was marked as potentially AI generated and will be closed now. If this is an error, please provide additional details, make sure to read the docs about contributing and AI."
4654
}
4755
}

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
pull-requests: write
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/labeler@v5
19+
- uses: actions/labeler@v6
2020
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
2121
- run: echo "Done adding labels"
2222
# Run this after labeler applied labels

.github/workflows/latest-changes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
latest-changes:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v6
2424
with:
2525
# To allow latest-changes to commit to the main branch
2626
token: ${{ secrets.SQLMODEL_LATEST_CHANGES }}
@@ -30,7 +30,7 @@ jobs:
3030
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
3131
with:
3232
limit-access-to-actor: true
33-
- uses: tiangolo/latest-changes@0.3.2
33+
- uses: tiangolo/latest-changes@0.4.1
3434
with:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
latest_changes_file: docs/release-notes.md

.github/workflows/pre-commit.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
env:
10+
# Forks and Dependabot don't have access to secrets
11+
HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }}
12+
13+
jobs:
14+
pre-commit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Dump GitHub context
18+
env:
19+
GITHUB_CONTEXT: ${{ toJson(github) }}
20+
run: echo "$GITHUB_CONTEXT"
21+
- uses: actions/checkout@v6
22+
name: Checkout PR for own repo
23+
if: env.HAS_SECRETS == 'true'
24+
with:
25+
# To be able to commit it needs to fetch the head of the branch, not the
26+
# merge commit
27+
ref: ${{ github.head_ref }}
28+
# And it needs the full history to be able to compute diffs
29+
fetch-depth: 0
30+
# A token other than the default GITHUB_TOKEN is needed to be able to trigger CI
31+
token: ${{ secrets.PRE_COMMIT }}
32+
# pre-commit lite ci needs the default checkout configs to work
33+
- uses: actions/checkout@v6
34+
name: Checkout PR for fork
35+
if: env.HAS_SECRETS == 'false'
36+
with:
37+
# To be able to commit it needs the head branch of the PR, the remote one
38+
ref: ${{ github.event.pull_request.head.sha }}
39+
fetch-depth: 0
40+
- name: Set up Python
41+
uses: actions/setup-python@v6
42+
with:
43+
python-version-file: ".python-version"
44+
- name: Setup uv
45+
uses: astral-sh/setup-uv@v7
46+
with:
47+
cache-dependency-glob: |
48+
pyproject.toml
49+
uv.lock
50+
- name: Install Dependencies
51+
run: uv sync --locked
52+
- name: Run prek - pre-commit
53+
id: precommit
54+
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure
55+
continue-on-error: true
56+
- name: Commit and push changes
57+
if: env.HAS_SECRETS == 'true'
58+
run: |
59+
git config user.name "github-actions[bot]"
60+
git config user.email "github-actions[bot]@users.noreply.github.com"
61+
git add -A
62+
if git diff --staged --quiet; then
63+
echo "No changes to commit"
64+
else
65+
git commit -m "🎨 Auto format"
66+
git push
67+
fi
68+
- uses: pre-commit-ci/lite-action@v1.1.0
69+
if: env.HAS_SECRETS == 'false'
70+
with:
71+
msg: 🎨 Auto format
72+
- name: Error out on pre-commit errors
73+
if: steps.precommit.outcome == 'failure'
74+
run: exit 1
75+
76+
# https://github.com/marketplace/actions/alls-green#why
77+
pre-commit-alls-green: # This job does nothing and is only used for the branch protection
78+
if: always()
79+
needs:
80+
- pre-commit
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Dump GitHub context
84+
env:
85+
GITHUB_CONTEXT: ${{ toJson(github) }}
86+
run: echo "$GITHUB_CONTEXT"
87+
- name: Decide whether the needed jobs succeeded or failed
88+
uses: re-actors/alls-green@release/v1
89+
with:
90+
jobs: ${{ toJSON(needs) }}

.github/workflows/publish.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,22 @@ 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
19+
contents: read
2420
steps:
25-
- uses: actions/checkout@v4
21+
- name: Dump GitHub context
22+
env:
23+
GITHUB_CONTEXT: ${{ toJson(github) }}
24+
run: echo "$GITHUB_CONTEXT"
25+
- uses: actions/checkout@v6
2626
- name: Set up Python
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
29-
python-version: "3.11"
30-
- name: Install build dependencies
31-
run: pip install build
29+
python-version-file: ".python-version"
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v7
3232
- name: Build distribution
33-
env:
34-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
35-
run: python -m build
33+
run: uv build
3634
- name: Publish
37-
uses: pypa/gh-action-pypi-publish@v1.12.4
35+
run: uv publish

0 commit comments

Comments
 (0)