Skip to content

Commit 750d1d0

Browse files
authored
Merge branch 'main' into main
2 parents 60bd15a + c6acc1f commit 750d1d0

177 files changed

Lines changed: 15183 additions & 3425 deletions

File tree

Some content is hidden

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

.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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
outputs:
2323
docs: ${{ steps.filter.outputs.docs }}
2424
steps:
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
2626
# For pull requests it's not necessary to checkout the code but for the main branch it is
2727
- uses: dorny/paths-filter@v3
2828
id: filter
@@ -53,13 +53,13 @@ jobs:
5353
env:
5454
GITHUB_CONTEXT: ${{ toJson(github) }}
5555
run: echo "$GITHUB_CONTEXT"
56-
- uses: actions/checkout@v4
56+
- uses: actions/checkout@v5
5757
- name: Set up Python
58-
uses: actions/setup-python@v5
58+
uses: actions/setup-python@v6
5959
with:
6060
python-version: "3.11"
6161
- name: Setup uv
62-
uses: astral-sh/setup-uv@v5
62+
uses: astral-sh/setup-uv@v6
6363
with:
6464
version: "0.4.15"
6565
enable-cache: true

.github/workflows/deploy-docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
env:
2424
GITHUB_CONTEXT: ${{ toJson(github) }}
2525
run: echo "$GITHUB_CONTEXT"
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v5
2727
- name: Set up Python
28-
uses: actions/setup-python@v5
28+
uses: actions/setup-python@v6
2929
with:
3030
python-version: "3.11"
3131
- name: Setup uv
32-
uses: astral-sh/setup-uv@v5
32+
uses: astral-sh/setup-uv@v6
3333
with:
3434
version: "0.4.15"
3535
enable-cache: true
@@ -49,7 +49,7 @@ jobs:
4949
run: |
5050
rm -rf ./site
5151
mkdir ./site
52-
- uses: actions/download-artifact@v4
52+
- uses: actions/download-artifact@v5
5353
with:
5454
path: ./site/
5555
pattern: docs-site
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/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.2
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.12.3
37+
uses: pypa/gh-action-pypi-publish@v1.13.0

.github/workflows/smokeshow.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,36 @@ jobs:
1616
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
20-
- uses: actions/setup-python@v5
19+
- uses: actions/checkout@v5
20+
- uses: actions/setup-python@v6
2121
with:
2222
python-version: '3.9'
2323
- name: Setup uv
24-
uses: astral-sh/setup-uv@v5
24+
uses: astral-sh/setup-uv@v6
2525
with:
2626
version: "0.4.15"
2727
enable-cache: true
2828
cache-dependency-glob: |
2929
requirements**.txt
3030
pyproject.toml
3131
- run: uv pip install -r requirements-github-actions.txt
32-
- uses: actions/download-artifact@v4
32+
- uses: actions/download-artifact@v5
3333
with:
3434
name: coverage-html
3535
path: htmlcov
3636
github-token: ${{ secrets.GITHUB_TOKEN }}
3737
run-id: ${{ github.event.workflow_run.id }}
38-
- 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
3949
env:
4050
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
4151
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

.github/workflows/test.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,42 @@ env:
2323

2424
jobs:
2525
test:
26-
runs-on: ubuntu-latest
2726
strategy:
2827
matrix:
29-
python-version:
30-
- "3.7"
31-
- "3.8"
32-
- "3.9"
33-
- "3.10"
34-
- "3.11"
35-
- "3.12"
28+
os: [ ubuntu-latest, windows-latest, macos-latest ]
29+
python-version: [ "3.13" ]
3630
pydantic-version:
3731
- pydantic-v1
3832
- pydantic-v2
33+
include:
34+
- os: macos-latest
35+
python-version: "3.8"
36+
pydantic-version: pydantic-v1
37+
- os: windows-latest
38+
python-version: "3.9"
39+
pydantic-version: pydantic-v2
40+
- os: ubuntu-latest
41+
python-version: "3.10"
42+
pydantic-version: pydantic-v1
43+
- os: macos-latest
44+
python-version: "3.11"
45+
pydantic-version: pydantic-v2
46+
- os: windows-latest
47+
python-version: "3.12"
48+
pydantic-version: pydantic-v1
49+
- os: ubuntu-latest
50+
python-version: "3.12"
51+
pydantic-version: pydantic-v2
3952
fail-fast: false
53+
runs-on: ${{ matrix.os }}
4054
steps:
41-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v5
4256
- name: Set up Python
43-
uses: actions/setup-python@v5
57+
uses: actions/setup-python@v6
4458
with:
4559
python-version: ${{ matrix.python-version }}
4660
- name: Setup uv
47-
uses: astral-sh/setup-uv@v5
61+
uses: astral-sh/setup-uv@v6
4862
with:
4963
version: "0.4.15"
5064
enable-cache: true
@@ -64,10 +78,9 @@ jobs:
6478
run: uv pip install --upgrade "pydantic>=1.10.0,<2.0.0"
6579
- name: Install Pydantic v2
6680
if: matrix.pydantic-version == 'pydantic-v2'
67-
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0" "typing-extensions==4.6.1"
81+
run: uv pip install --upgrade "pydantic>=2.0.2,<3.0.0"
6882
- name: Lint
69-
# Do not run on Python 3.7 as mypy behaves differently
70-
if: matrix.python-version != '3.7' && matrix.pydantic-version == 'pydantic-v2'
83+
if: matrix.pydantic-version == 'pydantic-v2' && matrix.python-version != '3.8'
7184
run: bash scripts/lint.sh
7285
- run: mkdir coverage
7386
- name: Test
@@ -78,7 +91,7 @@ jobs:
7891
- name: Store coverage files
7992
uses: actions/upload-artifact@v4
8093
with:
81-
name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
94+
name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
8295
path: coverage
8396
include-hidden-files: true
8497

@@ -87,20 +100,20 @@ jobs:
87100
- test
88101
runs-on: ubuntu-latest
89102
steps:
90-
- uses: actions/checkout@v4
91-
- uses: actions/setup-python@v5
103+
- uses: actions/checkout@v5
104+
- uses: actions/setup-python@v6
92105
with:
93-
python-version: '3.12'
106+
python-version: '3.13'
94107
- name: Setup uv
95-
uses: astral-sh/setup-uv@v5
108+
uses: astral-sh/setup-uv@v6
96109
with:
97110
version: "0.4.15"
98111
enable-cache: true
99112
cache-dependency-glob: |
100113
requirements**.txt
101114
pyproject.toml
102115
- name: Get coverage files
103-
uses: actions/download-artifact@v4
116+
uses: actions/download-artifact@v5
104117
with:
105118
pattern: coverage-*
106119
path: coverage

0 commit comments

Comments
 (0)