Skip to content

Commit 59916fe

Browse files
authored
Merge branch 'main' into add_raw_client_bench
2 parents 87f4bde + 9ff725f commit 59916fe

11 files changed

Lines changed: 409 additions & 387 deletions

File tree

.github/workflows/docs_build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with: # zizmor: ignore[artipacked]
1818
fetch-depth: 0
1919
token: ${{ secrets.AUTOMERGE_TOKEN }}
20-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
20+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2121
with:
2222
version: "latest"
2323
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -67,7 +67,7 @@ jobs:
6767
fi
6868
6969
- name: Commit
70-
uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
70+
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
7171
with:
7272
branch: gh-pages
7373
push_options: "--force" # force push to stay with clear gh-pages branch history

.github/workflows/docs_update-release-notes.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
persist-credentials: false
24-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
24+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2525
with:
2626
version: "latest"
2727

@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: Create Pull Request
4949
if: steps.git-check.outputs.changes_detected
50-
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
50+
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
5151
with:
5252
token: ${{ secrets.AUTOMERGE_TOKEN }}
5353
branch: ${{ env.BRANCH_NAME }}

.github/workflows/pr_autoupdate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
persist-credentials: false
2525

26-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
26+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2727
with:
2828
version: "latest"
2929

.github/workflows/pr_codeql.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161

6262
# Initializes the CodeQL tools for scanning.
6363
- name: Initialize CodeQL
64-
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5
64+
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
6565
with:
6666
languages: ${{ matrix.language }}
6767
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -75,7 +75,7 @@ jobs:
7575
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
7676
# If this step fails, then you should remove it and run the build manually (see below)
7777
- name: Autobuild
78-
uses: github/codeql-action/autobuild@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5
78+
uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
7979

8080
# ℹ️ Command-line programs to run using the OS shell.
8181
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -88,6 +88,6 @@ jobs:
8888
# ./location_of_script_within_repo/buildscript.sh
8989

9090
- name: Perform CodeQL Analysis
91-
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5
91+
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
9292
with:
9393
category: "/language:${{matrix.language}}"

.github/workflows/pr_tests.yaml

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ jobs:
2929
strategy:
3030
matrix:
3131
python-version: ["3.10", "3.11", "3.12", "3.13"]
32-
pydantic-version: ["pydantic-v1", "pydantic-v2"]
3332
fail-fast: false
3433

3534
steps:
3635
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3736
with:
3837
persist-credentials: false
39-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
38+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
4039
with:
4140
version: "latest"
4241
- name: Set up Python
@@ -46,22 +45,16 @@ jobs:
4645
- name: Install Dependencies
4746
run: |
4847
uv pip install --system --group optionals --group testing .
49-
- name: Install Pydantic v1
50-
if: matrix.pydantic-version == 'pydantic-v1'
51-
run: uv pip install --system "pydantic>=1.10.0,<2.0.0"
52-
- name: Install Pydantic v2
53-
if: matrix.pydantic-version == 'pydantic-v2'
54-
run: uv pip install --system --prerelease=disallow "pydantic>=2.0.0,<3.0.0"
5548
- name: Test
5649
run: >
5750
pytest --cov --cov-report=
5851
-vv -m "(slow and not connected) or not connected"
5952
- name: Rename coverage file
60-
run: mkdir coverage && mv .coverage coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
53+
run: mkdir coverage && mv .coverage coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
6154
- name: Store coverage files
62-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
55+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
6356
with:
64-
name: .coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
57+
name: .coverage.${{ runner.os }}-py${{ matrix.python-version }}
6558
path: coverage
6659
if-no-files-found: error
6760
include-hidden-files: true
@@ -73,7 +66,7 @@ jobs:
7366
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
7467
with:
7568
persist-credentials: false
76-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
69+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
7770
with:
7871
version: "latest"
7972
- name: Set up Python
@@ -90,7 +83,7 @@ jobs:
9083
- name: Rename coverage file
9184
run: mkdir coverage && mv .coverage coverage/.coverage.macos-latest
9285
- name: Store coverage files
93-
uses: actions/upload-artifact@v5
86+
uses: actions/upload-artifact@v6
9487
with:
9588
name: .coverage.macos-latest
9689
path: coverage
@@ -104,7 +97,7 @@ jobs:
10497
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
10598
with:
10699
persist-credentials: false
107-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
100+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
108101
with:
109102
version: "latest"
110103
- name: Set up Python
@@ -121,7 +114,7 @@ jobs:
121114
- name: Rename coverage file
122115
run: mkdir coverage && mv .coverage coverage/.coverage.windows-latest
123116
- name: Store coverage files
124-
uses: actions/upload-artifact@v5
117+
uses: actions/upload-artifact@v6
125118
with:
126119
name: .coverage.windows-latest
127120
path: coverage
@@ -135,7 +128,7 @@ jobs:
135128
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
136129
with:
137130
persist-credentials: false
138-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
131+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
139132
with:
140133
version: "latest"
141134
- name: Set up Python
@@ -177,7 +170,7 @@ jobs:
177170
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
178171
with:
179172
persist-credentials: false
180-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
173+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
181174
with:
182175
version: "latest"
183176
- name: Set up Python
@@ -194,7 +187,7 @@ jobs:
194187
- name: Rename coverage file
195188
run: mkdir coverage && mv .coverage coverage/.coverage.kafka-py
196189
- name: Store coverage files
197-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
190+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
198191
with:
199192
name: .coverage.kafka-py
200193
path: coverage
@@ -208,7 +201,7 @@ jobs:
208201
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
209202
with:
210203
persist-credentials: false
211-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
204+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
212205
with:
213206
version: "latest"
214207
- name: Set up Python
@@ -250,7 +243,7 @@ jobs:
250243
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
251244
with:
252245
persist-credentials: false
253-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
246+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
254247
with:
255248
version: "latest"
256249
- name: Set up Python
@@ -267,7 +260,7 @@ jobs:
267260
- name: Rename coverage file
268261
run: mkdir coverage && mv .coverage coverage/.coverage.confluent-py
269262
- name: Store coverage files
270-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
263+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
271264
with:
272265
name: .coverage.confluent-py
273266
path: coverage
@@ -281,7 +274,7 @@ jobs:
281274
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
282275
with:
283276
persist-credentials: false
284-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
277+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
285278
with:
286279
version: "latest"
287280
- name: Set up Python
@@ -311,7 +304,7 @@ jobs:
311304
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
312305
with:
313306
persist-credentials: false
314-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
307+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
315308
with:
316309
version: "latest"
317310
- name: Set up Python
@@ -328,7 +321,7 @@ jobs:
328321
- name: Rename coverage file
329322
run: mkdir coverage && mv .coverage coverage/.coverage.rabbit-py
330323
- name: Store coverage files
331-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
324+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
332325
with:
333326
name: .coverage.rabbit-py
334327
path: coverage
@@ -342,7 +335,7 @@ jobs:
342335
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
343336
with:
344337
persist-credentials: false
345-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
338+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
346339
with:
347340
version: "latest"
348341
- name: Set up Python
@@ -378,7 +371,7 @@ jobs:
378371
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
379372
with:
380373
persist-credentials: false
381-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
374+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
382375
with:
383376
version: "latest"
384377
- name: Set up Python
@@ -395,7 +388,7 @@ jobs:
395388
- name: Rename coverage file
396389
run: mkdir coverage && mv .coverage coverage/.coverage.nats-py
397390
- name: Store coverage files
398-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
391+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
399392
with:
400393
name: .coverage.nats-py
401394
path: coverage
@@ -409,7 +402,7 @@ jobs:
409402
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
410403
with:
411404
persist-credentials: false
412-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
405+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
413406
with:
414407
version: "latest"
415408
- name: Set up Python
@@ -439,7 +432,7 @@ jobs:
439432
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
440433
with:
441434
persist-credentials: false
442-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
435+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
443436
with:
444437
version: "latest"
445438
- name: Set up Python
@@ -456,7 +449,7 @@ jobs:
456449
- name: Rename coverage file
457450
run: mkdir coverage && mv .coverage coverage/.coverage.redis-py
458451
- name: Store coverage files
459-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
452+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
460453
with:
461454
name: .coverage.redis-py
462455
path: coverage
@@ -480,15 +473,15 @@ jobs:
480473
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
481474
with:
482475
persist-credentials: false
483-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
476+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
484477
with:
485478
version: "latest"
486479
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
487480
with:
488481
python-version: "3.12"
489482

490483
- name: Get coverage files
491-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
484+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
492485
with:
493486
pattern: .coverage*
494487
path: coverage
@@ -503,7 +496,7 @@ jobs:
503496
- run: coverage html --show-contexts --title "FastStream coverage for ${{ github.sha }}"
504497

505498
- name: Store coverage html
506-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
499+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
507500
with:
508501
name: coverage-html
509502
path: htmlcov

.github/workflows/publish_coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
1717
with:
1818
python-version: "3.9"
19-
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
19+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2020
with:
2121
version: "latest"
2222

2323
- run: |
2424
uv pip install --system smokeshow
2525
26-
- uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
26+
- uses: dawidd6/action-download-artifact@0bd50d53a6d7fb5cb921e607957e9cc12b4ce392 # v12
2727
with:
2828
workflow: pr_tests.yaml
2929
workflow_conclusion: success

docs/docs/en/getting-started/contributing/CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ just test-all
7979
To run tests with coverage:
8080

8181
```bash
82-
just coverage-test
82+
just test-coverage
83+
# or
84+
just test-coverage-all
8385
```
8486
If you need test only specific folder or broker:
8587

faststream/_internal/fastapi/_compat.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
FASTAPI_V2 = _FASTAPI_MAJOR > 0 or _FASTAPI_MINOR > 100
1818
FASTAPI_V106 = _FASTAPI_MAJOR > 0 or _FASTAPI_MINOR >= 106
1919
FASTAPI_V121 = _FASTAPI_MAJOR > 0 or _FASTAPI_MINOR >= 121
20+
FASTAPI_V128 = _FASTAPI_MAJOR > 0 or _FASTAPI_MINOR >= 128
2021

2122
try:
2223
_FASTAPI_PATCH = int(patch)
@@ -50,7 +51,13 @@ class SolvedDependency:
5051
background_tasks: BackgroundTasks | None
5152

5253

53-
if FASTAPI_V2:
54+
if FASTAPI_V128:
55+
from fastapi.exceptions import RequestValidationError
56+
57+
def raise_fastapi_validation_error(errors: list[Any], body: dict[str, Any]) -> Never:
58+
raise RequestValidationError(errors, body=body)
59+
60+
elif FASTAPI_V2:
5461
from fastapi._compat import _normalize_errors
5562
from fastapi.exceptions import RequestValidationError
5663

faststream/nats/subscriber/usecases/stream_pull_subscriber.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import anyio
66
from nats.errors import ConnectionClosedError, TimeoutError
7+
from nats.js.errors import ServiceUnavailableError
78
from typing_extensions import override
89

910
from faststream._internal.endpoint.subscriber.mixins import ConcurrentMixin, TasksMixin
@@ -76,7 +77,7 @@ async def _consume_pull(
7677

7778
while self.running: # pragma: no branch
7879
messages = []
79-
with suppress(TimeoutError, ConnectionClosedError):
80+
with suppress(TimeoutError, ConnectionClosedError, ServiceUnavailableError):
8081
messages = await self.subscription.fetch(
8182
batch=self.pull_sub.batch_size,
8283
timeout=self.pull_sub.timeout,
@@ -224,7 +225,7 @@ async def _consume_pull(self) -> None:
224225
assert self.subscription, "You should call `create_subscription` at first."
225226

226227
while self.running: # pragma: no branch
227-
with suppress(TimeoutError, ConnectionClosedError):
228+
with suppress(TimeoutError, ConnectionClosedError, ServiceUnavailableError):
228229
messages = await self.subscription.fetch(
229230
batch=self.pull_sub.batch_size,
230231
timeout=self.pull_sub.timeout,

0 commit comments

Comments
 (0)