Skip to content

Commit e488ec6

Browse files
authored
Merge branch 'master' into fix/sse-format-docstring-escape
2 parents 0df4aff + ad09734 commit e488ec6

8 files changed

Lines changed: 77 additions & 8 deletions

File tree

.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'

docs/en/docs/release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ hide:
1515

1616
### Internal
1717

18+
* ✅ Use custom `changing_dir` instead of `CLIRunner.isolated_filesystem` to set working dir. PR [#15616](https://github.com/fastapi/fastapi/pull/15616) by [@YuriiMotov](https://github.com/YuriiMotov).
19+
* ✅ Add `httpx2` test dependency to avoid deprecation warning. PR [#15603](https://github.com/fastapi/fastapi/pull/15603) by [@YuriiMotov](https://github.com/YuriiMotov).
1820
* ⬆ Bump the python-packages group with 15 updates. PR [#15594](https://github.com/fastapi/fastapi/pull/15594) by [@dependabot[bot]](https://github.com/apps/dependabot).
1921
* 👷 Configure Dependabot to group updates and update weekly. PR [#15560](https://github.com/fastapi/fastapi/pull/15560) by [@YuriiMotov](https://github.com/YuriiMotov).
2022

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ docs = [
146146
]
147147
docs-tests = [
148148
"httpx >=0.23.0,<1.0.0",
149+
"httpx2>=2.0.0",
149150
"ruff >=0.14.14",
150151
]
151152
github-actions = [

scripts/tests/test_translation_fixer/conftest.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import os
12
import shutil
23
import sys
4+
from collections.abc import Generator
5+
from contextlib import contextmanager
36
from pathlib import Path
47

58
import pytest
@@ -23,11 +26,20 @@ def pytest_collection_modifyitems(config, items: list[pytest.Item]) -> None:
2326
item.add_marker(skip_on_windows)
2427

2528

29+
@contextmanager
30+
def changing_dir(directory: str | Path) -> Generator[None, None, None]:
31+
initial_dir = os.getcwd()
32+
os.chdir(directory)
33+
try:
34+
yield
35+
finally:
36+
os.chdir(initial_dir)
37+
38+
2639
@pytest.fixture(name="runner")
27-
def get_runner():
28-
runner = CliRunner()
29-
with runner.isolated_filesystem():
30-
yield runner
40+
def get_runner(tmp_path: Path):
41+
with changing_dir(tmp_path):
42+
yield CliRunner()
3143

3244

3345
@pytest.fixture(name="root_dir")

tests/test_tutorial/test_header_param_models/test_tutorial001.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import importlib
22

33
import pytest
4+
from dirty_equals import IsOneOf
45
from fastapi.testclient import TestClient
56
from inline_snapshot import snapshot
67

@@ -68,7 +69,9 @@ def test_header_param_model_invalid(client: TestClient):
6869
"x_tag": [],
6970
"host": "testserver",
7071
"accept": "*/*",
71-
"accept-encoding": "gzip, deflate",
72+
"accept-encoding": IsOneOf(
73+
"gzip, deflate", "gzip, deflate, zstd"
74+
),
7275
"connection": "keep-alive",
7376
"user-agent": "testclient",
7477
},

tests/test_tutorial/test_header_param_models/test_tutorial003.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import importlib
22

33
import pytest
4+
from dirty_equals import IsOneOf
45
from fastapi.testclient import TestClient
56
from inline_snapshot import snapshot
67

@@ -66,7 +67,9 @@ def test_header_param_model_no_underscore(client: TestClient):
6667
"traceparent": "123",
6768
"x_tag": [],
6869
"accept": "*/*",
69-
"accept-encoding": "gzip, deflate",
70+
"accept-encoding": IsOneOf(
71+
"gzip, deflate", "gzip, deflate, zstd"
72+
),
7073
"connection": "keep-alive",
7174
"user-agent": "testclient",
7275
"save-data": "true",
@@ -105,7 +108,9 @@ def test_header_param_model_invalid(client: TestClient):
105108
"x_tag": [],
106109
"host": "testserver",
107110
"accept": "*/*",
108-
"accept-encoding": "gzip, deflate",
111+
"accept-encoding": IsOneOf(
112+
"gzip, deflate", "gzip, deflate, zstd"
113+
),
109114
"connection": "keep-alive",
110115
"user-agent": "testclient",
111116
},

uv.lock

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)