Skip to content

Commit d9b8f0b

Browse files
authored
Merge branch 'master' into bug/flat-fields-for-all-models
2 parents 8ef0ae7 + 7a03018 commit d9b8f0b

1,969 files changed

Lines changed: 62739 additions & 17378 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/labeler.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ internal:
2929
- scripts/**
3030
- .gitignore
3131
- .pre-commit-config.yaml
32-
- pdm_build.py
33-
- requirements*.txt
3432
- uv.lock
3533
- docs/en/data/sponsors.yml
3634
- docs/en/overrides/main.html

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
path: docs/${{ matrix.lang }}/.cache
9898
- name: Build Docs
9999
run: uv run ./scripts/docs.py build-lang ${{ matrix.lang }}
100-
- uses: actions/upload-artifact@v6
100+
- uses: actions/upload-artifact@v7
101101
with:
102102
name: docs-site-${{ matrix.lang }}
103103
path: ./site/**

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
rm -rf ./site
4747
mkdir ./site
48-
- uses: actions/download-artifact@v7
48+
- uses: actions/download-artifact@v8
4949
with:
5050
path: ./site/
5151
pattern: docs-site-*

.github/workflows/publish.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ on:
88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
package:
14-
- fastapi
15-
- fastapi-slim
1611
permissions:
1712
id-token: write
1813
contents: read
@@ -26,14 +21,9 @@ jobs:
2621
uses: actions/setup-python@v6
2722
with:
2823
python-version-file: ".python-version"
29-
# Issue ref: https://github.com/actions/setup-python/issues/436
30-
# cache: "pip"
31-
# cache-dependency-path: pyproject.toml
3224
- name: Install uv
3325
uses: astral-sh/setup-uv@v7
3426
- name: Build distribution
3527
run: uv build
36-
env:
37-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
3828
- name: Publish
3929
run: uv publish

.github/workflows/smokeshow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
pyproject.toml
2929
uv.lock
3030
- run: uv sync --locked --no-dev --group github-actions
31-
- uses: actions/download-artifact@v7
31+
- uses: actions/download-artifact@v8
3232
with:
3333
name: coverage-html
3434
path: htmlcov

.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-
- fastapi
19-
- fastapi-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/fastapi*/
4336
pip install --group tests --editable .[all]
44-
env:
45-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
4637
- name: Run source distribution tests
4738
run: |
4839
cd dist/fastapi*/

.github/workflows/test.yml

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414

1515
env:
1616
UV_NO_SYNC: true
17+
INLINE_SNAPSHOT_DEFAULT_FLAGS: review
1718

1819
jobs:
1920
changes:
@@ -44,7 +45,7 @@ jobs:
4445
test:
4546
needs:
4647
- changes
47-
if: needs.changes.outputs.src == 'true'
48+
if: needs.changes.outputs.src == 'true' || github.ref == 'refs/heads/master'
4849
strategy:
4950
matrix:
5051
os: [ windows-latest, macos-latest ]
@@ -55,14 +56,10 @@ jobs:
5556
- starlette-pypi
5657
- starlette-git
5758
include:
58-
- os: ubuntu-latest
59-
python-version: "3.9"
60-
coverage: coverage
61-
uv-resolution: lowest-direct
6259
- os: macos-latest
6360
python-version: "3.10"
6461
coverage: coverage
65-
uv-resolution: highest
62+
uv-resolution: lowest-direct
6663
- os: windows-latest
6764
python-version: "3.12"
6865
coverage: coverage
@@ -71,10 +68,8 @@ jobs:
7168
python-version: "3.13"
7269
coverage: coverage
7370
uv-resolution: highest
74-
# Ubuntu with 3.13 needs coverage for CodSpeed benchmarks
7571
- os: ubuntu-latest
7672
python-version: "3.13"
77-
coverage: coverage
7873
uv-resolution: highest
7974
codspeed: codspeed
8075
- os: ubuntu-latest
@@ -112,29 +107,52 @@ jobs:
112107
run: uv pip install "git+https://github.com/Kludex/starlette@main"
113108
- run: mkdir coverage
114109
- name: Test
115-
if: matrix.codspeed != 'codspeed'
116-
run: uv run --no-sync bash scripts/test.sh
110+
run: uv run --no-sync bash scripts/test-cov.sh
117111
env:
118112
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
119113
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
120-
- name: CodSpeed benchmarks
121-
if: matrix.codspeed == 'codspeed'
122-
uses: CodSpeedHQ/action@v4
123-
env:
124-
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
125-
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
126-
with:
127-
mode: simulation
128-
run: uv run --no-sync coverage run -m pytest tests/ --codspeed
129114
# Do not store coverage for all possible combinations to avoid file size max errors in Smokeshow
130115
- name: Store coverage files
131116
if: matrix.coverage == 'coverage'
132-
uses: actions/upload-artifact@v6
117+
uses: actions/upload-artifact@v7
133118
with:
134119
name: coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/coverage/.coverage.*') }}
135120
path: coverage
136121
include-hidden-files: true
137122

123+
benchmark:
124+
needs:
125+
- changes
126+
if: needs.changes.outputs.src == 'true' || github.ref == 'refs/heads/master'
127+
runs-on: ubuntu-latest
128+
env:
129+
UV_PYTHON: "3.13"
130+
UV_RESOLUTION: highest
131+
steps:
132+
- name: Dump GitHub context
133+
env:
134+
GITHUB_CONTEXT: ${{ toJson(github) }}
135+
run: echo "$GITHUB_CONTEXT"
136+
- uses: actions/checkout@v6
137+
- name: Set up Python
138+
uses: actions/setup-python@v6
139+
with:
140+
python-version: "3.13"
141+
- name: Setup uv
142+
uses: astral-sh/setup-uv@v7
143+
with:
144+
enable-cache: true
145+
cache-dependency-glob: |
146+
pyproject.toml
147+
uv.lock
148+
- name: Install Dependencies
149+
run: uv sync --no-dev --group tests --extra all
150+
- name: CodSpeed benchmarks
151+
uses: CodSpeedHQ/action@v4
152+
with:
153+
mode: simulation
154+
run: uv run --no-sync pytest tests/benchmarks --codspeed
155+
138156
coverage-combine:
139157
needs:
140158
- test
@@ -158,7 +176,7 @@ jobs:
158176
- name: Install Dependencies
159177
run: uv sync --locked --no-dev --group tests --extra all
160178
- name: Get coverage files
161-
uses: actions/download-artifact@v7
179+
uses: actions/download-artifact@v8
162180
with:
163181
pattern: coverage-*
164182
path: coverage
@@ -167,7 +185,7 @@ jobs:
167185
- run: uv run coverage combine coverage
168186
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
169187
- name: Store coverage HTML
170-
uses: actions/upload-artifact@v6
188+
uses: actions/upload-artifact@v7
171189
with:
172190
name: coverage-html
173191
path: htmlcov
@@ -179,6 +197,7 @@ jobs:
179197
if: always()
180198
needs:
181199
- coverage-combine
200+
- benchmark
182201
runs-on: ubuntu-latest
183202
steps:
184203
- name: Dump GitHub context
@@ -189,4 +208,4 @@ jobs:
189208
uses: re-actors/alls-green@release/v1
190209
with:
191210
jobs: ${{ toJSON(needs) }}
192-
allowed-skips: coverage-combine,test
211+
allowed-skips: coverage-combine,test,benchmark

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The key features are:
3434
* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance).
3535
* **Fast to code**: Increase the speed to develop features by about 200% to 300%. *
3636
* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *
37-
* **Intuitive**: Great editor support. <abbr title="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging.
37+
* **Intuitive**: Great editor support. <dfn title="also known as auto-complete, autocompletion, IntelliSense">Completion</dfn> everywhere. Less time debugging.
3838
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
3939
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
4040
* **Robust**: Get production-ready code. With automatic interactive documentation.
@@ -371,15 +371,15 @@ item: Item
371371
* Validation of data:
372372
* Automatic and clear errors when the data is invalid.
373373
* Validation even for deeply nested JSON objects.
374-
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of input data: coming from the network to Python data and types. Reading from:
374+
* <dfn title="also known as: serialization, parsing, marshalling">Conversion</dfn> of input data: coming from the network to Python data and types. Reading from:
375375
* JSON.
376376
* Path parameters.
377377
* Query parameters.
378378
* Cookies.
379379
* Headers.
380380
* Forms.
381381
* Files.
382-
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of output data: converting from Python data and types to network data (as JSON):
382+
* <dfn title="also known as: serialization, parsing, marshalling">Conversion</dfn> of output data: converting from Python data and types to network data (as JSON):
383383
* Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc).
384384
* `datetime` objects.
385385
* `UUID` objects.
@@ -442,7 +442,7 @@ For a more complete example including more features, see the <a href="https://fa
442442

443443
* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
444444
* How to set **validation constraints** as `maximum_length` or `regex`.
445-
* A very powerful and easy to use **<abbr title="also known as components, resources, providers, services, injectables">Dependency Injection</abbr>** system.
445+
* A very powerful and easy to use **<dfn title="also known as components, resources, providers, services, injectables">Dependency Injection</dfn>** system.
446446
* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
447447
* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
448448
* **GraphQL** integration with <a href="https://strawberry.rocks" class="external-link" target="_blank">Strawberry</a> and other libraries.
@@ -527,7 +527,7 @@ Used by Starlette:
527527

528528
* <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - Required if you want to use the `TestClient`.
529529
* <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - Required if you want to use the default template configuration.
530-
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - Required if you want to support form <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>, with `request.form()`.
530+
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - Required if you want to support form <dfn title="converting the string that comes from an HTTP request into Python data">"parsing"</dfn>, with `request.form()`.
531531

532532
Used by FastAPI:
533533

docs/de/docs/_llm-test.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Siehe Abschnitt `### Content of code snippets` im allgemeinen Prompt in `scripts
3535

3636
//// tab | Test
3737

38-
Gestern schrieb mein Freund: „Wenn man unkorrekt korrekt schreibt, hat man es unkorrekt geschrieben“. Worauf ich antwortete: „Korrekt, aber ‚unkorrekt‘ ist unkorrekterweise nicht ‚„unkorrekt“‘“.
38+
Gestern schrieb mein Freund: „Wenn man ‚incorrectly‘ korrekt schreibt, hat man es falsch geschrieben“. Worauf ich antwortete: „Korrekt, aber ‚incorrectly‘ ist inkorrekterweise nicht ‚„incorrectly“‘“.
3939

4040
/// note | Hinweis
4141

@@ -202,11 +202,6 @@ Hier einige Dinge, die in HTML-„abbr“-Elemente gepackt sind (einige sind erf
202202
* <abbr title="XML Web Token">XWT</abbr>
203203
* <abbr title="Paralleles Server-Gateway-Interface">PSGI</abbr>
204204

205-
### Das abbr gibt eine Erklärung { #the-abbr-gives-an-explanation }
206-
207-
* <abbr title="Eine Gruppe von Maschinen, die so konfiguriert sind, dass sie verbunden sind und in irgendeiner Weise zusammenarbeiten.">Cluster</abbr>
208-
* <abbr title="Eine Methode des Machine Learning, die künstliche neuronale Netze mit zahlreichen versteckten Schichten zwischen Eingabe- und Ausgabeschicht verwendet und so eine umfassende interne Struktur entwickelt">Deep Learning</abbr>
209-
210205
### Das abbr gibt eine vollständige Phrase und eine Erklärung { #the-abbr-gives-a-full-phrase-and-an-explanation }
211206

212207
* <abbr title="Mozilla Developer Network – Mozilla-Entwicklernetzwerk: Dokumentation für Entwickler, geschrieben von den Firefox-Leuten">MDN</abbr>
@@ -224,6 +219,11 @@ Siehe Abschnitt `### HTML abbr elements` im allgemeinen Prompt in `scripts/trans
224219

225220
////
226221

222+
## HTML „dfn“-Elemente { #html-dfn-elements }
223+
224+
* <dfn title="Eine Gruppe von Maschinen, die so konfiguriert sind, dass sie verbunden sind und in irgendeiner Weise zusammenarbeiten.">Cluster</dfn>
225+
* <dfn title="Eine Methode des Machine Learning, die künstliche neuronale Netze mit zahlreichen versteckten Schichten zwischen Eingabe- und Ausgabeschicht verwendet und so eine umfassende interne Struktur entwickelt">Deep Learning</dfn>
226+
227227
## Überschriften { #headings }
228228

229229
//// tab | Test
@@ -248,7 +248,7 @@ Die einzige strenge Regel für Überschriften ist, dass das LLM den Hash-Teil in
248248

249249
Siehe Abschnitt `### Headings` im allgemeinen Prompt in `scripts/translate.py`.
250250

251-
Für einige sprachspezifische Anweisungen, siehe z. B. den Abschnitt `### Headings` in `docs/de/llm-prompt.md`.
251+
Für einige sprachsspezifische Anweisungen, siehe z. B. den Abschnitt `### Headings` in `docs/de/llm-prompt.md`.
252252

253253
////
254254

docs/de/docs/advanced/additional-responses.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Jedes dieser Response-`dict`s kann einen Schlüssel `model` haben, welcher ein P
2626

2727
Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, können Sie schreiben:
2828

29-
{* ../../docs_src/additional_responses/tutorial001_py39.py hl[18,22] *}
29+
{* ../../docs_src/additional_responses/tutorial001_py310.py hl[18,22] *}
3030

3131
/// note | Hinweis
3232

@@ -203,7 +203,7 @@ Sie können beispielsweise eine Response mit dem Statuscode `404` deklarieren, d
203203

204204
Und eine Response mit dem Statuscode `200`, die Ihr `response_model` verwendet, aber ein benutzerdefiniertes Beispiel (`example`) enthält:
205205

206-
{* ../../docs_src/additional_responses/tutorial003_py39.py hl[20:31] *}
206+
{* ../../docs_src/additional_responses/tutorial003_py310.py hl[20:31] *}
207207

208208
Es wird alles kombiniert und in Ihre OpenAPI eingebunden und in der API-Dokumentation angezeigt:
209209

0 commit comments

Comments
 (0)