Skip to content

Commit 3a87839

Browse files
authored
Merge branch 'master' into fix/sse-trailing-newlines
2 parents 866e577 + ad09734 commit 3a87839

146 files changed

Lines changed: 2076 additions & 2063 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/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/dependabot.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,47 @@ updates:
44
- package-ecosystem: "github-actions"
55
directory: "/"
66
schedule:
7-
interval: "daily"
7+
interval: "weekly"
88
cooldown:
99
default-days: 7
1010
commit-message:
1111
prefix:
12+
labels:
13+
- "internal"
14+
- "dependencies"
15+
- "github_actions"
16+
groups:
17+
github-actions:
18+
patterns:
19+
- "*"
1220
# Python
1321
- package-ecosystem: "uv"
1422
directory: "/"
1523
schedule:
16-
interval: "daily"
24+
interval: "weekly"
1725
cooldown:
1826
default-days: 7
1927
commit-message:
2028
prefix:
29+
groups:
30+
python-packages:
31+
dependency-type: "development"
32+
patterns:
33+
- "*"
2134
# pre-commit
2235
- package-ecosystem: "pre-commit"
2336
directory: "/"
2437
schedule:
25-
interval: "daily"
38+
interval: "weekly"
2639
cooldown:
2740
default-days: 7
2841
commit-message:
2942
prefix:
43+
labels:
44+
- "internal"
45+
- "dependencies"
46+
- "pre-commit"
47+
groups:
48+
pre-commit:
49+
patterns:
50+
- "*"

.github/workflows/add-to-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: Add to project
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
17+
- uses: actions/add-to-project@5afcf98fcd03f1c2f92c3c83f58ae24323cc57fd # v2.0.0
1818
with:
1919
project-url: https://github.com/orgs/fastapi/projects/2
2020
github-token: ${{ secrets.PROJECTS_TOKEN }} # zizmor: ignore[secrets-outside-env]

.github/workflows/build-docs.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@ jobs:
3434
- docs_src/**
3535
- pyproject.toml
3636
- uv.lock
37-
- mkdocs.yml
38-
- mkdocs.env.yml
3937
- .github/workflows/build-docs.yml
4038
- .github/workflows/deploy-docs.yml
41-
- scripts/mkdocs_hooks.py
39+
- scripts/docs.py
4240
langs:
4341
needs:
4442
- changes
43+
if: ${{ needs.changes.outputs.docs == 'true' }}
4544
runs-on: ubuntu-latest
4645
outputs:
4746
langs: ${{ steps.show-langs.outputs.langs }}
@@ -103,26 +102,33 @@ jobs:
103102
run: uv run ./scripts/docs.py update-languages
104103
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
105104
with:
106-
key: mkdocs-cards-${{ matrix.lang }}-${{ github.ref }}
107-
path: docs/${{ matrix.lang }}/.cache
105+
key: zensical-${{ matrix.lang }}-${{ github.ref }}
106+
path: site_zensical_src/${{ matrix.lang }}/.cache
108107
- name: Build Docs
109108
run: | # zizmor: ignore[template-injection] - comes from trusted source
110109
uv run ./scripts/docs.py build-lang ${{ matrix.lang }}
111110
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
112111
with:
113112
name: docs-site-${{ matrix.lang }}
114-
path: ./site/**
113+
# English owns root static assets. Translated pages reference /img, /css,
114+
# and /js, so omit duplicated language-local copies from artifacts.
115+
path: |
116+
./site/**
117+
!./site/${{ matrix.lang }}/img/**
118+
!./site/${{ matrix.lang }}/css/**
119+
!./site/${{ matrix.lang }}/js/**
115120
include-hidden-files: true
116121

117122
# https://github.com/marketplace/actions/alls-green#why
118123
docs-all-green: # This job does nothing and is only used for the branch protection
119124
if: always()
120125
needs:
126+
- langs
121127
- build-docs
122128
runs-on: ubuntu-latest
123129
steps:
124130
- name: Decide whether the needed jobs succeeded or failed
125131
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
126132
with:
127133
jobs: ${{ toJSON(needs) }}
128-
allowed-skips: build-docs
134+
allowed-skips: langs, build-docs

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
env:
6161
PROJECT_NAME: fastapitiangolo
6262
BRANCH: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
63-
uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0
63+
uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0
6464
with:
6565
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} # zizmor: ignore[secrets-outside-env]
6666
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} # zizmor: ignore[secrets-outside-env]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Guard Dependencies
2+
3+
on:
4+
pull_request_target: # zizmor: ignore[dangerous-triggers] -- This workflow only reads context.payload metadata, never checks out PR code
5+
branches: [master]
6+
paths:
7+
- pyproject.toml
8+
- uv.lock
9+
10+
permissions:
11+
contents: read
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
check-author:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check if author is org member or allowed bot
20+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
21+
with:
22+
script: |
23+
const pr = context.payload.pull_request;
24+
const author = pr.user.login;
25+
const assoc = pr.author_association;
26+
27+
const botAllowlist = new Set(['dependabot[bot]']);
28+
const orgAuthorAssociations = new Set(['MEMBER', 'OWNER']);
29+
30+
const allowed =
31+
botAllowlist.has(author) ||
32+
(assoc != null && orgAuthorAssociations.has(assoc));
33+
34+
if (!allowed) {
35+
await github.rest.issues.createComment({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
issue_number: context.payload.pull_request.number,
39+
body: `This PR modifies dependency files (\`pyproject.toml\` or \`uv.lock\`), which is restricted to members of the **${context.repo.owner}** organization on GitHub.\n\nIf you need a dependency change, please [open a discussion](https://github.com/${context.repo.owner}/${context.repo.repo}/discussions/new) describing what you need and why.\n\nClosing this PR automatically.`
40+
});
41+
42+
await github.rest.pulls.update({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
pull_number: context.payload.pull_request.number,
46+
state: 'closed'
47+
});
48+
49+
core.setFailed('Dependency changes are restricted to organization members.');
50+
} else {
51+
console.log(`Author ${author} (author_association=${assoc}) is allowed to make dependency changes.`);
52+
}

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
pull-requests: write
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
21+
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
2222
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
2323
- run: echo "Done adding labels"
2424
# Run this after labeler applied labels

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3030
with:
3131
version: "0.11.4"
32+
enable-cache: "false"
3233
- name: Build distribution
3334
run: uv build
3435
- name: Publish

.github/workflows/test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ jobs:
8181
uv-resolution: highest
8282
codspeed: codspeed
8383
deprecated-tests: "no-deprecation"
84+
- os: ubuntu-latest
85+
python-version: "3.13"
86+
uv-resolution: highest
87+
deprecated-tests: "no-deprecation"
88+
without-httpx2: true
8489
- os: ubuntu-latest
8590
python-version: "3.14"
8691
coverage: coverage
@@ -129,15 +134,19 @@ jobs:
129134
- name: Install deprecated libraries just for testing
130135
if: matrix.deprecated-tests == 'test-deprecation'
131136
run: uv pip install orjson ujson
137+
- name: Uninstall httpx2 to run tests with httpx
138+
if: matrix.without-httpx2 == 'true'
139+
run: uv pip uninstall httpx2
132140
- name: Reinstall SQLAlchemy without Cython extensions
133141
if: matrix.python-version == '3.14t' && matrix.os == 'ubuntu-latest'
134142
run: "DISABLE_SQLALCHEMY_CEXT=1 uv pip install --force-reinstall --no-binary :all: sqlalchemy"
135143
- run: mkdir coverage
136144
- name: Test
137-
run: uv run --no-sync bash scripts/test-cov.sh
145+
run: uv run --no-sync bash scripts/test-cov.sh $PYTEST_OPTIONS
138146
env:
139147
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.deprecated-tests}}
140148
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.deprecated-tests}}
149+
PYTEST_OPTIONS: ${{ (matrix.without-httpx2 == 'true') && '-W ignore::UserWarning' || '' }}
141150
# Do not store coverage for all possible combinations to avoid file size max errors in Smokeshow
142151
- name: Store coverage files
143152
if: matrix.coverage == 'coverage'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __pycache__
77
htmlcov
88
dist
99
site
10+
site_zensical_src
1011
.coverage*
1112
coverage.xml
1213
.netlify

0 commit comments

Comments
 (0)