Skip to content

Commit 1036b6f

Browse files
authored
Merge branch 'main' into docs/fix-phrasing
2 parents 9f5b872 + c04a9ff commit 1036b6f

File tree

423 files changed

+6583
-27391
lines changed

Some content is hidden

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

423 files changed

+6583
-27391
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: 7 additions & 14 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
@@ -32,8 +28,8 @@ jobs:
3228
- README.md
3329
- docs/**
3430
- docs_src/**
35-
- requirements-docs.txt
3631
- pyproject.toml
32+
- uv.lock
3733
- mkdocs.yml
3834
- mkdocs.env.yml
3935
- .github/workflows/build-docs.yml
@@ -54,26 +50,23 @@ jobs:
5450
- name: Set up Python
5551
uses: actions/setup-python@v6
5652
with:
57-
python-version: "3.11"
53+
python-version-file: ".python-version"
5854
- name: Setup uv
5955
uses: astral-sh/setup-uv@v7
6056
with:
61-
version: "0.4.15"
6257
enable-cache: true
6358
cache-dependency-glob: |
64-
requirements**.txt
6559
pyproject.toml
60+
uv.lock
6661
- name: Install docs extras
67-
run: uv pip install -r requirements-docs.txt
68-
- uses: actions/cache@v4
62+
run: uv sync --locked --no-dev --group docs
63+
- uses: actions/cache@v5
6964
with:
7065
key: mkdocs-cards-${{ github.ref }}
7166
path: .cache
72-
- name: Verify README
73-
run: python ./scripts/docs.py verify-readme
7467
- name: Build Docs
75-
run: python ./scripts/docs.py build
76-
- uses: actions/upload-artifact@v5
68+
run: uv run ./scripts/docs.py build
69+
- uses: actions/upload-artifact@v7
7770
with:
7871
name: docs-site
7972
path: ./site/**

.github/workflows/deploy-docs.yml

Lines changed: 7 additions & 11 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
@@ -27,19 +24,18 @@ jobs:
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@v8
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/issue-manager.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ jobs:
4141
"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.",
4242
"reminder": {
4343
"before": "P3D",
44-
"message": "Heads-up: this will be closed in 3 days unless theres new activity."
44+
"message": "Heads-up: this will be closed in 3 days unless there's new activity."
4545
}
4646
},
4747
"invalid": {
4848
"delay": 0,
4949
"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."
5054
}
5155
}

.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: 10 additions & 12 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:
21+
- name: Dump GitHub context
22+
env:
23+
GITHUB_CONTEXT: ${{ toJson(github) }}
24+
run: echo "$GITHUB_CONTEXT"
2525
- uses: actions/checkout@v6
2626
- name: Set up Python
2727
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.13.0
35+
run: uv publish

.github/workflows/smokeshow.yml

Lines changed: 6 additions & 12 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:
1915
- 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@v8
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: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ on:
1212
jobs:
1313
test-redistribute:
1414
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
package:
18-
- sqlmodel
19-
- sqlmodel-slim
2015
steps:
2116
- name: Dump GitHub context
2217
env:
@@ -26,12 +21,10 @@ jobs:
2621
- name: Set up Python
2722
uses: actions/setup-python@v6
2823
with:
29-
python-version: "3.10"
24+
python-version-file: ".python-version"
3025
- name: Install build dependencies
3126
run: pip install build
3227
- name: Build source distribution
33-
env:
34-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
3528
run: python -m build --sdist
3629
- name: Decompress source distribution
3730
run: |
@@ -40,9 +33,7 @@ jobs:
4033
- name: Install test dependencies
4134
run: |
4235
cd dist/sqlmodel*/
43-
pip install -r requirements-tests.txt
44-
env:
45-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
36+
pip install --group tests --editable .
4637
- name: Run source distribution tests
4738
run: |
4839
cd dist/sqlmodel*/

0 commit comments

Comments
 (0)