Skip to content

Commit d8b7c88

Browse files
authored
Merge branch 'main' into rjmill/fix-generic
2 parents 25f6f99 + ac29fcd commit d8b7c88

File tree

361 files changed

+5964
-19895
lines changed

Some content is hidden

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

361 files changed

+5964
-19895
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/workflows/build-docs.yml

Lines changed: 11 additions & 24 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@v5
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,29 @@ jobs:
5346
env:
5447
GITHUB_CONTEXT: ${{ toJson(github) }}
5548
run: echo "$GITHUB_CONTEXT"
56-
- uses: actions/checkout@v5
49+
- uses: actions/checkout@v6
5750
- name: Set up Python
5851
uses: actions/setup-python@v6
5952
with:
60-
python-version: "3.11"
53+
python-version-file: ".python-version"
6154
- name: Setup uv
6255
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
8067
- name: Verify README
81-
run: python ./scripts/docs.py verify-readme
68+
run: uv run ./scripts/docs.py verify-readme
8269
- name: Build Docs
83-
run: python ./scripts/docs.py build
84-
- uses: actions/upload-artifact@v5
70+
run: uv run ./scripts/docs.py build
71+
- uses: actions/upload-artifact@v6
8572
with:
8673
name: docs-site
8774
path: ./site/**

.github/workflows/deploy-docs.yml

Lines changed: 8 additions & 12 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,23 +20,22 @@ jobs:
2320
env:
2421
GITHUB_CONTEXT: ${{ toJson(github) }}
2522
run: echo "$GITHUB_CONTEXT"
26-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2724
- name: Set up Python
2825
uses: actions/setup-python@v6
2926
with:
30-
python-version: "3.11"
27+
python-version-file: ".python-version"
3128
- name: Setup uv
3229
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 }}
@@ -49,7 +45,7 @@ jobs:
4945
run: |
5046
rm -rf ./site
5147
mkdir ./site
52-
- uses: actions/download-artifact@v6
48+
- uses: actions/download-artifact@v7
5349
with:
5450
path: ./site/
5551
pattern: docs-site
@@ -70,14 +66,14 @@ jobs:
7066
command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }}
7167
- name: Deploy Docs Status Error
7268
if: failure()
73-
run: python ./scripts/deploy_docs_status.py
69+
run: uv run ./scripts/deploy_docs_status.py
7470
env:
7571
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7672
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
7773
RUN_ID: ${{ github.run_id }}
7874
STATE: "error"
7975
- name: Comment Deploy
80-
run: python ./scripts/deploy_docs_status.py
76+
run: uv run ./scripts/deploy_docs_status.py
8177
env:
8278
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8379
DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }}

.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@v5
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.4.0
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: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ jobs:
2121
- sqlmodel-slim
2222
permissions:
2323
id-token: write
24+
contents: read
2425
steps:
25-
- uses: actions/checkout@v5
26+
- name: Dump GitHub context
27+
env:
28+
GITHUB_CONTEXT: ${{ toJson(github) }}
29+
run: echo "$GITHUB_CONTEXT"
30+
- uses: actions/checkout@v6
2631
- name: Set up Python
2732
uses: actions/setup-python@v6
2833
with:
29-
python-version: "3.11"
30-
- name: Install build dependencies
31-
run: pip install build
34+
python-version-file: ".python-version"
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v7
3237
- name: Build distribution
38+
run: uv build
3339
env:
3440
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
35-
run: python -m build
3641
- name: Publish
37-
uses: pypa/gh-action-pypi-publish@v1.13.0
42+
run: uv publish

.github/workflows/smokeshow.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,22 @@ on:
88
permissions:
99
statuses: write
1010

11-
env:
12-
UV_SYSTEM_PYTHON: 1
13-
1411
jobs:
1512
smokeshow:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1713
runs-on: ubuntu-latest
1814
steps:
19-
- uses: actions/checkout@v5
15+
- uses: actions/checkout@v6
2016
- uses: actions/setup-python@v6
2117
with:
22-
python-version: '3.9'
18+
python-version-file: ".python-version"
2319
- name: Setup uv
2420
uses: astral-sh/setup-uv@v7
2521
with:
26-
version: "0.4.15"
27-
enable-cache: true
2822
cache-dependency-glob: |
29-
requirements**.txt
3023
pyproject.toml
31-
- run: uv pip install -r requirements-github-actions.txt
32-
- uses: actions/download-artifact@v6
24+
uv.lock
25+
- run: uv sync --locked --no-dev --group github-actions
26+
- uses: actions/download-artifact@v7
3327
with:
3428
name: coverage-html
3529
path: htmlcov
@@ -39,7 +33,7 @@ jobs:
3933
- name: Upload coverage to Smokeshow
4034
run: |
4135
for i in 1 2 3 4 5; do
42-
if smokeshow upload htmlcov; then
36+
if uv run smokeshow upload htmlcov; then
4337
echo "Smokeshow upload success!"
4438
break
4539
fi
@@ -48,7 +42,7 @@ jobs:
4842
done
4943
env:
5044
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
51-
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 95
45+
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 99
5246
SMOKESHOW_GITHUB_CONTEXT: coverage
5347
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5448
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}

.github/workflows/test-redistribute.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
env:
2323
GITHUB_CONTEXT: ${{ toJson(github) }}
2424
run: echo "$GITHUB_CONTEXT"
25-
- uses: actions/checkout@v5
25+
- uses: actions/checkout@v6
2626
- name: Set up Python
2727
uses: actions/setup-python@v6
2828
with:
29-
python-version: "3.10"
29+
python-version-file: ".python-version"
3030
- name: Install build dependencies
3131
run: pip install build
3232
- name: Build source distribution
@@ -40,7 +40,7 @@ jobs:
4040
- name: Install test dependencies
4141
run: |
4242
cd dist/sqlmodel*/
43-
pip install -r requirements-tests.txt
43+
pip install --group tests --editable .
4444
env:
4545
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
4646
- name: Run source distribution tests

0 commit comments

Comments
 (0)