Skip to content

Commit 41f61aa

Browse files
committed
Merge branch 'main' into bugfix-57/literal-satype
2 parents 0e2b815 + 5611bda commit 41f61aa

45 files changed

Lines changed: 3638 additions & 1509 deletions

Some content is hidden

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

.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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ internal:
1818
- .pre-commit-config.yaml
1919
- pdm_build.py
2020
- requirements*.txt
21+
- uv.lock
2122
- all-globs-to-all-files:
2223
- '!docs/**'
2324
- '!sqlmodel/**'

.github/workflows/build-docs.yml

Lines changed: 6 additions & 11 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,25 +50,24 @@ 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
62+
run: uv sync --locked --no-dev --group docs
6863
- uses: actions/cache@v5
6964
with:
7065
key: mkdocs-cards-${{ github.ref }}
7166
path: .cache
7267
- name: Verify README
73-
run: python ./scripts/docs.py verify-readme
68+
run: uv run ./scripts/docs.py verify-readme
7469
- name: Build Docs
75-
run: python ./scripts/docs.py build
70+
run: uv run ./scripts/docs.py build
7671
- uses: actions/upload-artifact@v6
7772
with:
7873
name: docs-site

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 10 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 }}
@@ -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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,15 @@ jobs:
4040
- name: Set up Python
4141
uses: actions/setup-python@v6
4242
with:
43-
python-version: "3.14"
43+
python-version-file: ".python-version"
4444
- name: Setup uv
4545
uses: astral-sh/setup-uv@v7
4646
with:
4747
cache-dependency-glob: |
48-
requirements**.txt
4948
pyproject.toml
5049
uv.lock
5150
- name: Install Dependencies
52-
run: |
53-
uv venv
54-
uv pip install -r requirements.txt
51+
run: uv sync --locked
5552
- name: Run prek - pre-commit
5653
id: precommit
5754
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure

.github/workflows/publish.yml

Lines changed: 10 additions & 5 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:
26+
- name: Dump GitHub context
27+
env:
28+
GITHUB_CONTEXT: ${{ toJson(github) }}
29+
run: echo "$GITHUB_CONTEXT"
2530
- 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: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,21 @@ on:
88
permissions:
99
statuses: write
1010

11-
env:
12-
UV_SYSTEM_PYTHON: 1
13-
1411
jobs:
1512
smokeshow:
1613
runs-on: ubuntu-latest
1714
steps:
1815
- uses: actions/checkout@v6
1916
- uses: actions/setup-python@v6
2017
with:
21-
python-version: '3.13'
18+
python-version-file: ".python-version"
2219
- name: Setup uv
2320
uses: astral-sh/setup-uv@v7
2421
with:
2522
cache-dependency-glob: |
26-
requirements**.txt
2723
pyproject.toml
28-
- run: uv pip install -r requirements-github-actions.txt
24+
uv.lock
25+
- run: uv sync --locked --no-dev --group github-actions
2926
- uses: actions/download-artifact@v7
3027
with:
3128
name: coverage-html
@@ -36,7 +33,7 @@ jobs:
3633
- name: Upload coverage to Smokeshow
3734
run: |
3835
for i in 1 2 3 4 5; do
39-
if smokeshow upload htmlcov; then
36+
if uv run smokeshow upload htmlcov; then
4037
echo "Smokeshow upload success!"
4138
break
4239
fi

.github/workflows/test-redistribute.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
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

.github/workflows/test.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,31 @@ on:
1919
- cron: "0 0 * * 1"
2020

2121
env:
22-
UV_SYSTEM_PYTHON: 1
22+
UV_NO_SYNC: true
2323

2424
jobs:
2525
test:
2626
strategy:
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
2929
python-version: [ "3.14" ]
30-
pydantic-version:
31-
- pydantic-v2
3230
include:
3331
- os: windows-latest
3432
python-version: "3.9"
35-
pydantic-version: pydantic-v2
3633
- os: ubuntu-latest
3734
python-version: "3.10"
38-
pydantic-version: pydantic-v1
3935
- os: macos-latest
4036
python-version: "3.11"
41-
pydantic-version: pydantic-v2
4237
- os: windows-latest
4338
python-version: "3.12"
44-
pydantic-version: pydantic-v1
4539
- os: ubuntu-latest
4640
python-version: "3.13"
47-
pydantic-version: pydantic-v1
4841
- os: macos-latest
4942
python-version: "3.13"
50-
pydantic-version: pydantic-v2
5143
fail-fast: false
5244
runs-on: ${{ matrix.os }}
45+
env:
46+
UV_PYTHON: ${{ matrix.python-version }}
5347
steps:
5448
- uses: actions/checkout@v6
5549
- name: Set up Python
@@ -59,28 +53,21 @@ jobs:
5953
- name: Setup uv
6054
uses: astral-sh/setup-uv@v7
6155
with:
62-
version: "0.4.15"
6356
enable-cache: true
6457
cache-dependency-glob: |
65-
requirements**.txt
6658
pyproject.toml
59+
uv.lock
6760
# Allow debugging with tmate
6861
- name: Setup tmate session
6962
uses: mxschmitt/action-tmate@v3
7063
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
7164
with:
7265
limit-access-to-actor: true
7366
- name: Install Dependencies
74-
run: uv pip install -r requirements-tests.txt
75-
- name: Install Pydantic v1
76-
if: matrix.pydantic-version == 'pydantic-v1'
77-
run: uv pip install --upgrade "pydantic>=1.10.0,<2.0.0"
78-
- name: Install Pydantic v2
79-
if: matrix.pydantic-version == 'pydantic-v2'
80-
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0"
67+
run: uv sync --locked --no-dev --group tests
8168
- run: mkdir coverage
8269
- name: Test
83-
run: bash scripts/test.sh
70+
run: uv run bash scripts/test.sh
8471
env:
8572
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
8673
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
@@ -99,33 +86,32 @@ jobs:
9986
- uses: actions/checkout@v6
10087
- uses: actions/setup-python@v6
10188
with:
102-
python-version: '3.13'
89+
python-version-file: ".python-version"
10390
- name: Setup uv
10491
uses: astral-sh/setup-uv@v7
10592
with:
106-
version: "0.4.15"
10793
enable-cache: true
10894
cache-dependency-glob: |
109-
requirements**.txt
11095
pyproject.toml
96+
uv.lock
11197
- name: Get coverage files
11298
uses: actions/download-artifact@v7
11399
with:
114100
pattern: coverage-*
115101
path: coverage
116102
merge-multiple: true
117103
- name: Install Dependencies
118-
run: uv pip install -r requirements-tests.txt
104+
run: uv sync --locked --no-dev --group tests
119105
- run: ls -la coverage
120-
- run: coverage combine coverage
121-
- run: coverage html --title "Coverage for ${{ github.sha }}"
106+
- run: uv run coverage combine coverage
107+
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
122108
- name: Store coverage HTML
123109
uses: actions/upload-artifact@v6
124110
with:
125111
name: coverage-html
126112
path: htmlcov
127113
include-hidden-files: true
128-
- run: coverage report --fail-under=99
114+
- run: uv run coverage report --fail-under=99
129115

130116
# https://github.com/marketplace/actions/alls-green#why
131117
alls-green: # This job does nothing and is only used for the branch protection

0 commit comments

Comments
 (0)