Skip to content

Commit 1532a86

Browse files
committed
Merge remote-tracking branch 'upstream/main' into KimigaiiWuyi_main
2 parents 8186e34 + 3e123f7 commit 1532a86

File tree

242 files changed

+1676
-8696
lines changed

Some content is hidden

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

242 files changed

+1676
-8696
lines changed

.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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ jobs:
6464
with:
6565
key: mkdocs-cards-${{ github.ref }}
6666
path: .cache
67-
- name: Verify README
68-
run: uv run ./scripts/docs.py verify-readme
6967
- name: Build Docs
7068
run: uv run ./scripts/docs.py build
7169
- uses: actions/upload-artifact@v6

.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/test-redistribute.yml

Lines changed: 0 additions & 9 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:
@@ -30,8 +25,6 @@ jobs:
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: |
@@ -41,8 +34,6 @@ jobs:
4134
run: |
4235
cd dist/sqlmodel*/
4336
pip install --group tests --editable .
44-
env:
45-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
4637
- name: Run source distribution tests
4738
run: |
4839
cd dist/sqlmodel*/

.github/workflows/test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,29 @@ jobs:
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
2929
python-version: [ "3.14" ]
30+
uv-resolution:
31+
- highest
3032
include:
31-
- os: windows-latest
32-
python-version: "3.9"
3333
- os: ubuntu-latest
3434
python-version: "3.10"
35+
uv-resolution: lowest-direct
3536
- os: macos-latest
3637
python-version: "3.11"
38+
uv-resolution: highest
3739
- os: windows-latest
3840
python-version: "3.12"
41+
uv-resolution: lowest-direct
3942
- os: ubuntu-latest
4043
python-version: "3.13"
44+
uv-resolution: highest
4145
- os: macos-latest
4246
python-version: "3.13"
47+
uv-resolution: highest
4348
fail-fast: false
4449
runs-on: ${{ matrix.os }}
4550
env:
4651
UV_PYTHON: ${{ matrix.python-version }}
52+
UV_RESOLUTION: ${{ matrix.uv-resolution }}
4753
steps:
4854
- uses: actions/checkout@v6
4955
- name: Set up Python
@@ -64,7 +70,7 @@ jobs:
6470
with:
6571
limit-access-to-actor: true
6672
- name: Install Dependencies
67-
run: uv sync --locked --no-dev --group tests
73+
run: uv sync --no-dev --group tests
6874
- run: mkdir coverage
6975
- name: Test
7076
run: uv run bash scripts/test.sh

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,22 @@ repos:
2828
language: unsupported
2929
types: [python]
3030

31+
- id: local-mypy
32+
name: mypy check
33+
entry: uv run mypy sqlmodel tests/test_select_typing.py
34+
require_serial: true
35+
language: unsupported
36+
pass_filenames: false
37+
3138
- id: generate-select
3239
language: unsupported
3340
name: generate-select
3441
entry: uv run ./scripts/generate_select.py
3542
files: ^scripts/generate_select\.py|sqlmodel/sql/_expression_select_gen\.py\.jinja2$
43+
44+
- id: generate-readme
45+
language: unsupported
46+
name: generate README.md from index.md
47+
entry: uv run ./scripts/docs.py generate-readme
48+
files: ^docs/index\.md|scripts/docs\.py$
49+
pass_filenames: false

docs/contributing.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,39 @@ This helps to make sure that:
158158
* The documentation is up-to-date.
159159
* The documentation examples can be run as is.
160160
* Most of the features are covered by the documentation, ensured by test coverage.
161+
162+
## Automated Code and AI
163+
164+
You are encouraged to use all the tools you want to do your work and contribute as efficiently as possible, this includes AI (LLM) tools, etc. Nevertheless, contributions should have meaningful human intervention, judgement, context, etc.
165+
166+
If the **human effort** put in a PR, e.g. writing LLM prompts, is **less** than the **effort we would need to put** to **review it**, please **don't** submit the PR.
167+
168+
Think of it this way: we can already write LLM prompts or run automated tools ourselves, and that would be faster than reviewing external PRs.
169+
170+
### Closing Automated and AI PRs
171+
172+
If we see PRs that seem AI generated or automated in similar ways, we'll flag them and close them.
173+
174+
The same applies to comments and descriptions, please don't copy paste the content generated by an LLM.
175+
176+
### Human Effort Denial of Service
177+
178+
Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack" class="external-link" target="_blank">Denial-of-service attack</a> on our human effort.
179+
180+
It would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).
181+
182+
Please don't do that.
183+
184+
We'll need to block accounts that spam us with repeated automated PRs or comments.
185+
186+
### Use Tools Wisely
187+
188+
As Uncle Ben said:
189+
190+
<blockquote>
191+
With great <strike>power</strike> <strong>tools</strong> comes great responsibility.
192+
</blockquote>
193+
194+
Avoid inadvertently doing harm.
195+
196+
You have amazing tools at hand, use them wisely to help effectively.

docs/js/custom.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ function setupTermynal() {
8181
}
8282
}
8383
saveBuffer();
84+
const inputCommands = useLines.filter(line => line.type === "input").map(line => line.value).join("\n");
85+
node.textContent = inputCommands;
8486
const div = document.createElement("div");
85-
node.replaceWith(div);
87+
node.style.display = "none";
88+
node.after(div);
8689
const termynal = new Termynal(div, {
8790
lineData: useLines,
8891
noInit: true,

docs/management-tasks.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Make sure you use a supported label from the <a href="https://github.com/tiangol
6868
* `refactor`: Refactors
6969
* This is normally for changes to the internal code that don't change the behavior. Normally it improves maintainability, or enables future features, etc.
7070
* `upgrade`: Upgrades
71-
* This is for upgrades to direct dependencies from the project, or extra optional dependencies, normally in `pyproject.toml`. So, things that would affect final users, they would end up receiving the upgrade in their code base once they update. But this is not for upgrades to internal dependencies used for development, testing, docs, etc. Those internal dependencies, normally in `requirements.txt` files or GitHub Action versions should be marked as `internal`, not `upgrade`.
71+
* This is for upgrades to direct dependencies from the project, or extra optional dependencies, normally in `pyproject.toml`. So, things that would affect final users, they would end up receiving the upgrade in their code base once they update. But this is not for upgrades to internal dependencies used for development, testing, docs, etc. Those internal dependencies or GitHub Action versions should be marked as `internal`, not `upgrade`.
7272
* `docs`: Docs
7373
* Changes in docs. This includes updating the docs, fixing typos. But it doesn't include changes to translations.
7474
* You can normally quickly detect it by going to the "Files changed" tab in the PR and checking if the updated file(s) starts with `docs/en/docs`. The original version of the docs is always in English, so in `docs/en/docs`.
@@ -83,9 +83,13 @@ Some tools like Dependabot, will add some labels, like `dependencies`, but have
8383

8484
## Review PRs
8585

86-
If a PR doesn't explain what it does or why, ask for more information.
86+
* If a PR doesn't explain what it does or why, if it seems like it could be useful, ask for more information. Otherwise, feel free to close it.
8787

88-
A PR should have a specific use case that it is solving.
88+
* If a PR seems to be spam, meaningless, only to change statistics (to appear as "contributor") or similar, you can simply mark it as `invalid`, and it will be automatically closed.
89+
90+
* If a PR seems to be AI generated, and seems like reviewing it would take more time from you than the time it took to write the prompt, mark it as `maybe-ai`, and it will be automatically closed.
91+
92+
* A PR should have a specific use case that it is solving.
8993

9094
* If the PR is for a feature, it should have docs.
9195
* Unless it's a feature we want to discourage, like support for a corner case that we don't want users to use.
@@ -103,13 +107,11 @@ A PR should have a specific use case that it is solving.
103107

104108
Dependabot will create PRs to update dependencies for several things, and those PRs all look similar, but some are way more delicate than others.
105109

106-
* If the PR is for a direct dependency, so, Dependabot is modifying `pyproject.toml`, **don't merge it**. 😱 Let me check it first. There's a good chance that some additional tweaks or updates are needed.
107-
* If the PR updates one of the internal dependencies, for example it's modifying `requirements.txt` files, or GitHub Action versions, if the tests are passing, the release notes (shown in a summary in the PR) don't show any obvious potential breaking change, you can merge it. 😎
110+
* If the PR is for a direct dependency, so, Dependabot is modifying `pyproject.toml` in the main dependencies, **don't merge it**. 😱 Let me check it first. There's a good chance that some additional tweaks or updates are needed.
111+
* If the PR updates one of the internal dependencies, for example the group `dev` in `pyproject.toml`, or GitHub Action versions, if the tests are passing, the release notes (shown in a summary in the PR) don't show any obvious potential breaking change, you can merge it. 😎
108112

109113
## Mark GitHub Discussions Answers
110114

111115
When a question in GitHub Discussions has been answered, mark the answer by clicking "Mark as answer".
112116

113-
Many of the current Discussion Questions were migrated from old issues. Many have the label `answered`, that means they were answered when they were issues, but now in GitHub Discussions, it's not known what is the actual response from the messages.
114-
115117
You can filter discussions by <a href="https://github.com/fastapi/sqlmodel/discussions/categories/questions?discussions_q=category:Questions+is:open+is:unanswered" class="external-link" target="_blank">`Questions` that are `Unanswered`</a>.

docs/release-notes.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,77 @@
22

33
## Latest Changes
44

5+
## 0.0.35
6+
7+
### Breaking Changes
8+
9+
* ➖ Drop support for Python 3.9. PR [#1766](https://github.com/fastapi/sqlmodel/pull/1766) by [@tiangolo](https://github.com/tiangolo).
10+
11+
### Internal
12+
13+
* 🔨 Add script to remove Python 3.9 files, migrate to Python 3.10. PR [#1767](https://github.com/fastapi/sqlmodel/pull/1767) by [@tiangolo](https://github.com/tiangolo).
14+
* ⬆ Bump prek from 0.3.2 to 0.3.3. PR [#1761](https://github.com/fastapi/sqlmodel/pull/1761) by [@dependabot[bot]](https://github.com/apps/dependabot).
15+
* ⬆ Bump typer from 0.23.1 to 0.23.2. PR [#1760](https://github.com/fastapi/sqlmodel/pull/1760) by [@dependabot[bot]](https://github.com/apps/dependabot).
16+
17+
## 0.0.34
18+
19+
### Internal
20+
21+
* 👷 Enable tests with lower and upper bound versions. PR [#1735](https://github.com/fastapi/sqlmodel/pull/1735) by [@tiangolo](https://github.com/tiangolo).
22+
* ⬆ Bump ruff from 0.15.0 to 0.15.1. PR [#1758](https://github.com/fastapi/sqlmodel/pull/1758) by [@dependabot[bot]](https://github.com/apps/dependabot).
23+
* ⬆ Bump typer from 0.23.0 to 0.23.1. PR [#1759](https://github.com/fastapi/sqlmodel/pull/1759) by [@dependabot[bot]](https://github.com/apps/dependabot).
24+
* ⬆ Bump typer from 0.21.2 to 0.23.0. PR [#1756](https://github.com/fastapi/sqlmodel/pull/1756) by [@dependabot[bot]](https://github.com/apps/dependabot).
25+
* ⬆ Bump fastapi from 0.128.7 to 0.128.8. PR [#1755](https://github.com/fastapi/sqlmodel/pull/1755) by [@dependabot[bot]](https://github.com/apps/dependabot).
26+
27+
## 0.0.33
28+
29+
### Docs
30+
31+
* ✏️ Fix typos in inline comment in `expression.py`. PR [#1747](https://github.com/fastapi/sqlmodel/pull/1747) by [@veeceey](https://github.com/veeceey).
32+
* 📝 Fix async example in `session.execute()` docstring & deprecation message. PR [#1643](https://github.com/fastapi/sqlmodel/pull/1643) by [@DanielLeviLucas](https://github.com/DanielLeviLucas).
33+
* 📝 Update `management-tasks.md` to be in line with `management-tasks.md` in FastAPI repo. PR [#1743](https://github.com/fastapi/sqlmodel/pull/1743) by [@YuriiMotov](https://github.com/YuriiMotov).
34+
35+
### Internal
36+
37+
* 🔨 Update build script for `sqlmodel-slim`. PR [#1754](https://github.com/fastapi/sqlmodel/pull/1754) by [@tiangolo](https://github.com/tiangolo).
38+
* ⬆ Bump fastapi from 0.128.6 to 0.128.7. PR [#1751](https://github.com/fastapi/sqlmodel/pull/1751) by [@dependabot[bot]](https://github.com/apps/dependabot).
39+
* ⬆ Bump typer from 0.21.1 to 0.21.2. PR [#1752](https://github.com/fastapi/sqlmodel/pull/1752) by [@dependabot[bot]](https://github.com/apps/dependabot).
40+
* 👷 Update build setup for `sqlmodel-slim`, deprecate it, and make it only depend on `sqlmodel`. PR [#1753](https://github.com/fastapi/sqlmodel/pull/1753) by [@tiangolo](https://github.com/tiangolo).
41+
* ⬆ Bump fastapi from 0.128.3 to 0.128.6. PR [#1750](https://github.com/fastapi/sqlmodel/pull/1750) by [@dependabot[bot]](https://github.com/apps/dependabot).
42+
* ⬆ Bump fastapi from 0.128.1 to 0.128.3. PR [#1746](https://github.com/fastapi/sqlmodel/pull/1746) by [@dependabot[bot]](https://github.com/apps/dependabot).
43+
* ⬆ Bump prek from 0.3.1 to 0.3.2. PR [#1745](https://github.com/fastapi/sqlmodel/pull/1745) by [@dependabot[bot]](https://github.com/apps/dependabot).
44+
* ⬆ Bump fastapi from 0.128.0 to 0.128.1. PR [#1742](https://github.com/fastapi/sqlmodel/pull/1742) by [@dependabot[bot]](https://github.com/apps/dependabot).
45+
* ✅ Update `ValidationError` schema in FastAPI-related tests to be compatible with FastAPI 0.128.1+. PR [#1744](https://github.com/fastapi/sqlmodel/pull/1744) by [@YuriiMotov](https://github.com/YuriiMotov).
46+
* ⬆ Bump ruff from 0.14.14 to 0.15.0. PR [#1740](https://github.com/fastapi/sqlmodel/pull/1740) by [@dependabot[bot]](https://github.com/apps/dependabot).
47+
* 👷 Add generate-readme to pre-commit. PR [#1741](https://github.com/fastapi/sqlmodel/pull/1741) by [@tiangolo](https://github.com/tiangolo).
48+
* 👷 Run mypy by pre-commit. PR [#1738](https://github.com/fastapi/sqlmodel/pull/1738) by [@YuriiMotov](https://github.com/YuriiMotov).
49+
* ⬆ Bump prek from 0.3.0 to 0.3.1. PR [#1739](https://github.com/fastapi/sqlmodel/pull/1739) by [@dependabot[bot]](https://github.com/apps/dependabot).
50+
51+
## 0.0.32
52+
53+
### Fixes
54+
55+
* 🐛 Fix support for `Annotated` fields with Pydantic 2.12+. PR [#1607](https://github.com/fastapi/sqlmodel/pull/1607) by [@vimota](https://github.com/vimota).
56+
57+
### Refactors
58+
59+
* ♻️ Import `Literal` from the `typing` module directly. PR [#1699](https://github.com/fastapi/sqlmodel/pull/1699) by [@svlandeg](https://github.com/svlandeg).
60+
561
### Docs
662

63+
* 📝 Add contribution instructions about LLM generated code and comments and automated tools for PRs. PR [#1712](https://github.com/fastapi/sqlmodel/pull/1712) by [@alejsdev](https://github.com/alejsdev).
64+
* 🐛 Fix copy button in `custom.js`. PR [#1711](https://github.com/fastapi/sqlmodel/pull/1711) by [@alejsdev](https://github.com/alejsdev).
765
* 📝 Remove duplicated word in `read-relationships.md`. PR [#1705](https://github.com/fastapi/sqlmodel/pull/1705) by [@stefmolin](https://github.com/stefmolin).
866

967
### Internal
1068

69+
* ⬆ Bump ruff from 0.14.13 to 0.14.14. PR [#1721](https://github.com/fastapi/sqlmodel/pull/1721) by [@dependabot[bot]](https://github.com/apps/dependabot).
70+
* ⬆ Bump prek from 0.2.30 to 0.3.0. PR [#1720](https://github.com/fastapi/sqlmodel/pull/1720) by [@dependabot[bot]](https://github.com/apps/dependabot).
71+
* 🔧 Ensure that an edit to `uv.lock` gets the `internal` label. PR [#1719](https://github.com/fastapi/sqlmodel/pull/1719) by [@svlandeg](https://github.com/svlandeg).
72+
* ⬆ Bump sqlalchemy from 2.0.45 to 2.0.46. PR [#1717](https://github.com/fastapi/sqlmodel/pull/1717) by [@dependabot[bot]](https://github.com/apps/dependabot).
73+
* ⬆ Bump typer from 0.21.0 to 0.21.1. PR [#1715](https://github.com/fastapi/sqlmodel/pull/1715) by [@dependabot[bot]](https://github.com/apps/dependabot).
74+
* ⬆ Bump ruff from 0.14.10 to 0.14.13. PR [#1714](https://github.com/fastapi/sqlmodel/pull/1714) by [@dependabot[bot]](https://github.com/apps/dependabot).
75+
* ⬆ Bump prek from 0.2.25 to 0.2.30. PR [#1716](https://github.com/fastapi/sqlmodel/pull/1716) by [@dependabot[bot]](https://github.com/apps/dependabot).
1176
* ⬆️ Update FastAPI version pin to `>=0.103.2` in tests. PR [#1709](https://github.com/fastapi/sqlmodel/pull/1709) by [@YuriiMotov](https://github.com/YuriiMotov).
1277
* 📌 Pin development Python version to 3.10, for `deploy_docs_status.py`. PR [#1707](https://github.com/fastapi/sqlmodel/pull/1707) by [@tiangolo](https://github.com/tiangolo).
1378
* ⬆️ Migrate to uv. PR [#1688](https://github.com/fastapi/sqlmodel/pull/1688) by [@DoctorJohn](https://github.com/DoctorJohn).

0 commit comments

Comments
 (0)