Skip to content

Commit 2e1fa51

Browse files
authored
Merge branch 'main' into main
2 parents 055b50c + c5085b6 commit 2e1fa51

File tree

287 files changed

+23046
-15254
lines changed

Some content is hidden

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

287 files changed

+23046
-15254
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/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ contact_links:
44
about: Please report security vulnerabilities to [email protected]
55
- name: Question or Problem
66
about: Ask a question or ask about a problem in GitHub Discussions.
7-
url: https://github.com/tiangolo/sqlmodel/discussions/categories/questions
7+
url: https://github.com/fastapi/sqlmodel/discussions/categories/questions
88
- name: Feature Request
99
about: To suggest an idea or ask about a feature, please start with a question saying what you would like to achieve. There might be a way to do it already.
10-
url: https://github.com/tiangolo/sqlmodel/discussions/categories/questions
10+
url: https://github.com/fastapi/sqlmodel/discussions/categories/questions
1111
- name: Show and tell
1212
about: Show what you built with SQLModel or to be used with SQLModel.
13-
url: https://github.com/tiangolo/sqlmodel/discussions/categories/show-and-tell
13+
url: https://github.com/fastapi/sqlmodel/discussions/categories/show-and-tell

.github/ISSUE_TEMPLATE/privileged.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
value: |
77
Thanks for your interest in SQLModel! 🚀
88
9-
If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/tiangolo/sqlmodel/discussions/categories/questions) instead.
9+
If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/fastapi/sqlmodel/discussions/categories/questions) instead.
1010
- type: checkboxes
1111
id: privileged
1212
attributes:

.github/actions/comment-docs-preview-in-pr/Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/actions/comment-docs-preview-in-pr/action.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/actions/comment-docs-preview-in-pr/app/main.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/labeler.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
docs:
2+
- all:
3+
- changed-files:
4+
- any-glob-to-any-file:
5+
- docs/**
6+
- docs_src/**
7+
- all-globs-to-all-files:
8+
- '!sqlmodel/**'
9+
- '!pyproject.toml'
10+
11+
internal:
12+
- all:
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- .github/**
16+
- scripts/**
17+
- .gitignore
18+
- .pre-commit-config.yaml
19+
- pdm_build.py
20+
- requirements*.txt
21+
- all-globs-to-all-files:
22+
- '!docs/**'
23+
- '!sqlmodel/**'
24+
- '!pyproject.toml'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Add to Project
2+
3+
on:
4+
pull_request_target:
5+
issues:
6+
types:
7+
- opened
8+
- reopened
9+
10+
jobs:
11+
add-to-project:
12+
name: Add to project
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
with:
17+
project-url: https://github.com/orgs/fastapi/projects/2
18+
github-token: ${{ secrets.PROJECTS_TOKEN }}

.github/workflows/build-docs.yml

Lines changed: 27 additions & 16 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,9 +22,9 @@ 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
22-
- uses: dorny/paths-filter@v2
27+
- uses: dorny/paths-filter@v3
2328
id: filter
2429
with:
2530
filters: |
@@ -28,11 +33,15 @@ jobs:
2833
- docs/**
2934
- docs_src/**
3035
- requirements-docs.txt
36+
- requirements-docs-insiders.txt
3137
- pyproject.toml
3238
- mkdocs.yml
3339
- mkdocs.insiders.yml
40+
- mkdocs.maybe-insiders.yml
41+
- mkdocs.no-insiders.yml
3442
- .github/workflows/build-docs.yml
3543
- .github/workflows/deploy-docs.yml
44+
- data/**
3645
3746
build-docs:
3847
needs:
@@ -44,37 +53,39 @@ jobs:
4453
env:
4554
GITHUB_CONTEXT: ${{ toJson(github) }}
4655
run: echo "$GITHUB_CONTEXT"
47-
- uses: actions/checkout@v4
56+
- uses: actions/checkout@v5
4857
- name: Set up Python
4958
uses: actions/setup-python@v5
5059
with:
5160
python-version: "3.11"
52-
- uses: actions/cache@v3
53-
id: cache
61+
- name: Setup uv
62+
uses: astral-sh/setup-uv@v6
5463
with:
55-
path: ${{ env.pythonLocation }}
56-
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt') }}-v01
64+
version: "0.4.15"
65+
enable-cache: true
66+
cache-dependency-glob: |
67+
requirements**.txt
68+
pyproject.toml
5769
- name: Install docs extras
58-
if: steps.cache.outputs.cache-hit != 'true'
59-
run: pip install -r requirements-docs.txt
70+
run: uv pip install -r requirements-docs.txt
6071
- name: Install Material for MkDocs Insiders
61-
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
62-
run: |
63-
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
64-
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
65-
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
66-
- uses: actions/cache@v3
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
6777
with:
6878
key: mkdocs-cards-${{ github.ref }}
6979
path: .cache
7080
- name: Verify README
7181
run: python ./scripts/docs.py verify-readme
7282
- name: Build Docs
7383
run: python ./scripts/docs.py build
74-
- uses: actions/upload-artifact@v3
84+
- uses: actions/upload-artifact@v4
7585
with:
7686
name: docs-site
7787
path: ./site/**
88+
include-hidden-files: true
7889

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

.github/workflows/deploy-docs.yml

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
deployments: write
11+
issues: write
12+
pull-requests: write
13+
statuses: write
14+
15+
env:
16+
UV_SYSTEM_PYTHON: 1
17+
918
jobs:
1019
deploy-docs:
1120
runs-on: ubuntu-latest
@@ -14,35 +23,56 @@ jobs:
1423
env:
1524
GITHUB_CONTEXT: ${{ toJson(github) }}
1625
run: echo "$GITHUB_CONTEXT"
17-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v5
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.11"
31+
- name: Setup uv
32+
uses: astral-sh/setup-uv@v6
33+
with:
34+
version: "0.4.15"
35+
enable-cache: true
36+
cache-dependency-glob: |
37+
requirements**.txt
38+
pyproject.toml
39+
- name: Install GitHub Actions dependencies
40+
run: uv pip install -r requirements-github-actions.txt
41+
- name: Deploy Docs Status Pending
42+
run: python ./scripts/deploy_docs_status.py
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
46+
RUN_ID: ${{ github.run_id }}
47+
1848
- name: Clean site
1949
run: |
2050
rm -rf ./site
2151
mkdir ./site
22-
- name: Download Artifact Docs
23-
id: download
24-
uses: dawidd6/[email protected]
52+
- uses: actions/download-artifact@v5
2553
with:
26-
if_no_artifact_found: ignore
27-
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
workflow: build-docs.yml
29-
run_id: ${{ github.event.workflow_run.id }}
30-
name: docs-site
3154
path: ./site/
55+
pattern: docs-site
56+
merge-multiple: true
57+
github-token: ${{ secrets.GITHUB_TOKEN }}
58+
run-id: ${{ github.event.workflow_run.id }}
3259
- name: Deploy to Cloudflare Pages
33-
if: steps.download.outputs.found_artifact == 'true'
60+
# hashFiles returns an empty string if there are no files
61+
if: hashFiles('./site/*')
3462
id: deploy
35-
uses: cloudflare/pages-action@v1
63+
env:
64+
PROJECT_NAME: sqlmodel
65+
BRANCH: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'main' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
66+
uses: cloudflare/wrangler-action@v3
3667
with:
3768
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
3869
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
39-
projectName: sqlmodel
40-
directory: './site'
41-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
42-
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'main' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
70+
command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }}
4371
- name: Comment Deploy
44-
if: steps.deploy.outputs.url != ''
45-
uses: ./.github/actions/comment-docs-preview-in-pr
46-
with:
47-
token: ${{ secrets.GITHUB_TOKEN }}
48-
deploy_url: "${{ steps.deploy.outputs.url }}"
72+
run: python ./scripts/deploy_docs_status.py
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }}
76+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
77+
RUN_ID: ${{ github.run_id }}
78+
IS_DONE: "true"

0 commit comments

Comments
 (0)