Skip to content

Commit 6eb35b9

Browse files
authored
Merge branch 'main' into main
2 parents 915c51a + a85de91 commit 6eb35b9

File tree

198 files changed

+15697
-14689
lines changed

Some content is hidden

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

198 files changed

+15697
-14689
lines changed

.github/DISCUSSION_TEMPLATE/questions.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,14 @@ body:
6464
If I (or someone) can copy it, run it, and see it right away, there's a much higher chance I (or someone) will be able to help you.
6565
6666
placeholder: |
67-
from typing import Optional
68-
6967
from sqlmodel import Field, Session, SQLModel, create_engine
7068
7169
7270
class Hero(SQLModel, table=True):
73-
id: Optional[int] = Field(default=None, primary_key=True)
71+
id: int | None = Field(default=None, primary_key=True)
7472
name: str
7573
secret_name: str
76-
age: Optional[int] = None
74+
age: int | None = None
7775
7876
7977
hero_1 = Hero(name="Deadpond", secret_name="Dive Wilson")

.github/workflows/build-docs.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
types:
88
- opened
99
- synchronize
10+
11+
env:
12+
UV_SYSTEM_PYTHON: 1
13+
14+
1015
jobs:
1116
changes:
1217
runs-on: ubuntu-latest
@@ -17,7 +22,7 @@ jobs:
1722
outputs:
1823
docs: ${{ steps.filter.outputs.docs }}
1924
steps:
20-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
2126
# For pull requests it's not necessary to checkout the code but for the main branch it is
2227
- uses: dorny/paths-filter@v3
2328
id: filter
@@ -36,6 +41,7 @@ jobs:
3641
- mkdocs.no-insiders.yml
3742
- .github/workflows/build-docs.yml
3843
- .github/workflows/deploy-docs.yml
44+
- data/**
3945
4046
build-docs:
4147
needs:
@@ -47,22 +53,24 @@ jobs:
4753
env:
4854
GITHUB_CONTEXT: ${{ toJson(github) }}
4955
run: echo "$GITHUB_CONTEXT"
50-
- uses: actions/checkout@v4
56+
- uses: actions/checkout@v5
5157
- name: Set up Python
52-
uses: actions/setup-python@v5
58+
uses: actions/setup-python@v6
5359
with:
5460
python-version: "3.11"
55-
- uses: actions/cache@v4
56-
id: cache
61+
- name: Setup uv
62+
uses: astral-sh/setup-uv@v6
5763
with:
58-
path: ${{ env.pythonLocation }}
59-
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-insiders.txt', 'requirements-docs-tests.txt') }}-v02
64+
version: "0.4.15"
65+
enable-cache: true
66+
cache-dependency-glob: |
67+
requirements**.txt
68+
pyproject.toml
6069
- name: Install docs extras
61-
if: steps.cache.outputs.cache-hit != 'true'
62-
run: pip install -r requirements-docs.txt
70+
run: uv pip install -r requirements-docs.txt
6371
- name: Install Material for MkDocs Insiders
64-
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
65-
run: pip install -r requirements-docs-insiders.txt
72+
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
73+
run: uv pip install -r requirements-docs-insiders.txt
6674
env:
6775
TOKEN: ${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}
6876
- uses: actions/cache@v4

.github/workflows/deploy-docs.yml

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

15+
env:
16+
UV_SYSTEM_PYTHON: 1
17+
1518
jobs:
1619
deploy-docs:
1720
runs-on: ubuntu-latest
@@ -20,31 +23,33 @@ jobs:
2023
env:
2124
GITHUB_CONTEXT: ${{ toJson(github) }}
2225
run: echo "$GITHUB_CONTEXT"
23-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v5
2427
- name: Set up Python
25-
uses: actions/setup-python@v5
28+
uses: actions/setup-python@v6
2629
with:
2730
python-version: "3.11"
28-
- uses: actions/cache@v4
29-
id: cache
31+
- name: Setup uv
32+
uses: astral-sh/setup-uv@v6
3033
with:
31-
path: ${{ env.pythonLocation }}
32-
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
34+
version: "0.4.15"
35+
enable-cache: true
36+
cache-dependency-glob: |
37+
requirements**.txt
38+
pyproject.toml
3339
- name: Install GitHub Actions dependencies
34-
if: steps.cache.outputs.cache-hit != 'true'
35-
run: pip install -r requirements-github-actions.txt
40+
run: uv pip install -r requirements-github-actions.txt
3641
- name: Deploy Docs Status Pending
3742
run: python ./scripts/deploy_docs_status.py
3843
env:
3944
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4045
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
4146
RUN_ID: ${{ github.run_id }}
42-
47+
STATE: "pending"
4348
- name: Clean site
4449
run: |
4550
rm -rf ./site
4651
mkdir ./site
47-
- uses: actions/download-artifact@v4
52+
- uses: actions/download-artifact@v5
4853
with:
4954
path: ./site/
5055
pattern: docs-site
@@ -63,11 +68,19 @@ jobs:
6368
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
6469
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
6570
command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }}
71+
- name: Deploy Docs Status Error
72+
if: failure()
73+
run: python ./scripts/deploy_docs_status.py
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
77+
RUN_ID: ${{ github.run_id }}
78+
STATE: "error"
6679
- name: Comment Deploy
6780
run: python ./scripts/deploy_docs_status.py
6881
env:
6982
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7083
DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }}
7184
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
7285
RUN_ID: ${{ github.run_id }}
73-
IS_DONE: "true"
86+
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: 5 additions & 1 deletion
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: >
@@ -39,5 +39,9 @@ jobs:
3939
"waiting": {
4040
"delay": 2628000,
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."
42+
},
43+
"invalid": {
44+
"delay": 0,
45+
"message": "This was marked as invalid and will be closed now. If this is an error, please provide additional details."
4246
}
4347
}

.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@v5
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.1
33+
- uses: tiangolo/latest-changes@0.4.0
3434
with:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
latest_changes_file: docs/release-notes.md

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
permissions:
2323
id-token: write
2424
steps:
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
2626
- name: Set up Python
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: "3.11"
3030
- name: Install build dependencies
@@ -34,4 +34,4 @@ jobs:
3434
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
3535
run: python -m build
3636
- name: Publish
37-
uses: pypa/gh-action-pypi-publish@v1.9.0
37+
uses: pypa/gh-action-pypi-publish@v1.13.0

.github/workflows/smokeshow.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,44 @@ on:
88
permissions:
99
statuses: write
1010

11+
env:
12+
UV_SYSTEM_PYTHON: 1
13+
1114
jobs:
1215
smokeshow:
1316
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1417
runs-on: ubuntu-latest
15-
1618
steps:
17-
- uses: actions/setup-python@v5
19+
- uses: actions/checkout@v5
20+
- uses: actions/setup-python@v6
1821
with:
1922
python-version: '3.9'
20-
21-
- run: pip install smokeshow
22-
23-
- uses: actions/download-artifact@v4
23+
- name: Setup uv
24+
uses: astral-sh/setup-uv@v6
25+
with:
26+
version: "0.4.15"
27+
enable-cache: true
28+
cache-dependency-glob: |
29+
requirements**.txt
30+
pyproject.toml
31+
- run: uv pip install -r requirements-github-actions.txt
32+
- uses: actions/download-artifact@v5
2433
with:
2534
name: coverage-html
2635
path: htmlcov
2736
github-token: ${{ secrets.GITHUB_TOKEN }}
2837
run-id: ${{ github.event.workflow_run.id }}
29-
30-
- run: smokeshow upload htmlcov
38+
# Try 5 times to upload coverage to smokeshow
39+
- name: Upload coverage to Smokeshow
40+
run: |
41+
for i in 1 2 3 4 5; do
42+
if smokeshow upload htmlcov; then
43+
echo "Smokeshow upload success!"
44+
break
45+
fi
46+
echo "Smokeshow upload error, sleep 1 sec and try again."
47+
sleep 1
48+
done
3149
env:
3250
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
3351
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 95

.github/workflows/test-redistribute.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
env:
2323
GITHUB_CONTEXT: ${{ toJson(github) }}
2424
run: echo "$GITHUB_CONTEXT"
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
2626
- name: Set up Python
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: "3.10"
3030
- name: Install build dependencies

0 commit comments

Comments
 (0)