From 08b86ee69a3ae7d939ba048bf3b1d90ed2b087e0 Mon Sep 17 00:00:00 2001 From: "Oleg A." Date: Sat, 12 Oct 2024 12:42:36 +0300 Subject: [PATCH 1/7] Replace async Event with bool (#1846) * fix: replace async Event with bool * chore: ignore ASYNC110 * fix: replace asyncio with anyio --- faststream/_internal/application.py | 10 +++++++--- faststream/app.py | 12 +++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/faststream/_internal/application.py b/faststream/_internal/application.py index dd0140db4d..ff2e39fac4 100644 --- a/faststream/_internal/application.py +++ b/faststream/_internal/application.py @@ -23,7 +23,6 @@ P_HookParams = ParamSpec("P_HookParams") T_HookReturn = TypeVar("T_HookReturn") - if TYPE_CHECKING: from faststream.asyncapi.schema import ( Contact, @@ -71,7 +70,7 @@ def __init__( ) -> None: context.set_global("app", self) - self._should_exit = anyio.Event() + self._should_exit = False self.broker = broker self.logger = logger self.context = context @@ -159,7 +158,12 @@ def after_shutdown( def exit(self) -> None: """Stop application manually.""" - self._should_exit.set() + self._should_exit = True + + async def _main_loop(self, sleep_time: float) -> None: + """Run loop till exit signal.""" + while not self._should_exit: # noqa: ASYNC110 (requested by creator) + await anyio.sleep(sleep_time) async def start( self, diff --git a/faststream/app.py b/faststream/app.py index 3f6c2d546f..debe04f7dc 100644 --- a/faststream/app.py +++ b/faststream/app.py @@ -10,7 +10,7 @@ ) import anyio -from typing_extensions import Annotated, ParamSpec, deprecated +from typing_extensions import ParamSpec from faststream._compat import ExceptionGroup from faststream._internal.application import Application @@ -35,13 +35,7 @@ async def run( self, log_level: int = logging.INFO, run_extra_options: Optional[Dict[str, "SettingField"]] = None, - sleep_time: Annotated[ - float, - deprecated( - "Deprecated in **FastStream 0.5.24**. " - "Argument will be removed in **FastStream 0.6.0**." - ), - ] = 0.1, + sleep_time: float = 0.1, ) -> None: """Run FastStream Application.""" assert self.broker, "You should setup a broker" # nosec B101 @@ -54,7 +48,7 @@ async def run( try: async with anyio.create_task_group() as tg: tg.start_soon(self._startup, log_level, run_extra_options) - await self._should_exit.wait() + await self._main_loop(sleep_time) await self._shutdown(log_level) tg.cancel_scope.cancel() except ExceptionGroup as e: From c23106e2fc13c2e553401b38b177d8924d53c2cc Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Sat, 12 Oct 2024 17:53:20 +0200 Subject: [PATCH 2/7] Add support for Python 3.13 (#1845) * upgraded Python to 3.13 * tests: fix 3.13 tabulation problem --------- Co-authored-by: Nikita Pastukhov --- .github/workflows/pr_tests.yaml | 26 +++++++------- pyproject.toml | 6 +++- .../asyncapi_customization/test_handler.py | 36 +++++++++++++------ 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pr_tests.yaml b/.github/workflows/pr_tests.yaml index 7cb3f21fcc..5e7259a6fb 100644 --- a/.github/workflows/pr_tests.yaml +++ b/.github/workflows/pr_tests.yaml @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] pydantic-version: ["pydantic-v1", "pydantic-v2"] fail-fast: false @@ -105,7 +105,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -124,7 +124,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -143,7 +143,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -182,7 +182,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -212,7 +212,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -251,7 +251,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -281,7 +281,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -309,7 +309,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -339,7 +339,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -367,7 +367,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -397,7 +397,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -425,7 +425,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | diff --git a/pyproject.toml b/pyproject.toml index edfbea8cd8..9c070bc318 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", @@ -66,7 +67,10 @@ rabbit = ["aio-pika>=9,<10"] kafka = ["aiokafka>=0.9,<0.12"] -confluent = ["confluent-kafka>=2,<3"] +confluent = [ + "confluent-kafka>=2,<3; python_version < '3.13'", + "confluent-kafka>=2.6,<3; python_version >= '3.13'", +] nats = ["nats-py>=2.7.0,<=3.0.0"] diff --git a/tests/a_docs/getting_started/asyncapi/asyncapi_customization/test_handler.py b/tests/a_docs/getting_started/asyncapi/asyncapi_customization/test_handler.py index 6453f5a8d8..31eead7a3b 100644 --- a/tests/a_docs/getting_started/asyncapi/asyncapi_customization/test_handler.py +++ b/tests/a_docs/getting_started/asyncapi/asyncapi_customization/test_handler.py @@ -1,3 +1,5 @@ +from dirty_equals import IsPartialDict + from docs.docs_src.getting_started.asyncapi.asyncapi_customization.custom_handler import ( app, ) @@ -7,21 +9,33 @@ def test_handler_customization(): schema = get_app_schema(app).to_jsonable() - assert schema["channels"] == { - "input_data:Consume": { - "description": "Consumer function\n\n Args:\n msg: input msg\n ", + (subscriber_key, subscriber_value), (publisher_key, publisher_value) = schema[ + "channels" + ].items() + + assert subscriber_key == "input_data:Consume", subscriber_key + assert subscriber_value == IsPartialDict( + { "servers": ["development"], "bindings": {"kafka": {"topic": "input_data", "bindingVersion": "0.4.0"}}, "subscribe": { "message": {"$ref": "#/components/messages/input_data:Consume:Message"} }, - }, - "output_data:Produce": { - "description": "My publisher description", - "servers": ["development"], - "bindings": {"kafka": {"topic": "output_data", "bindingVersion": "0.4.0"}}, - "publish": { - "message": {"$ref": "#/components/messages/output_data:Produce:Message"} - }, + } + ), subscriber_value + desc = subscriber_value["description"] + assert ( # noqa: PT018 + "Consumer function\n\n" in desc + and "Args:\n" in desc + and " msg: input msg" in desc + ), desc + + assert publisher_key == "output_data:Produce", publisher_key + assert publisher_value == { + "description": "My publisher description", + "servers": ["development"], + "bindings": {"kafka": {"topic": "output_data", "bindingVersion": "0.4.0"}}, + "publish": { + "message": {"$ref": "#/components/messages/output_data:Produce:Message"} }, } From 10a079625d03da6504c2041d5ce77c56c8efb360 Mon Sep 17 00:00:00 2001 From: "airt-release-notes-updater[bot]" <153718812+airt-release-notes-updater[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 18:51:12 +0000 Subject: [PATCH 3/7] Update Release Notes for 0.5.26 (#1847) * Update Release Notes for 0.5.26 * Update release.md * Update detect secrets --------- Co-authored-by: Lancetnik <44573917+Lancetnik@users.noreply.github.com> Co-authored-by: Pastukhov Nikita Co-authored-by: Kumaran Rajendhiran --- .secrets.baseline | 4 ++-- docs/docs/en/release.md | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index f4836e2025..88df582f08 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -153,7 +153,7 @@ "filename": "docs/docs/en/release.md", "hashed_secret": "35675e68f4b5af7b995d9205ad0fc43842f16450", "is_verified": false, - "line_number": 1723, + "line_number": 1745, "is_secret": false } ], @@ -178,5 +178,5 @@ } ] }, - "generated_at": "2024-09-25T19:57:57Z" + "generated_at": "2024-10-12T18:42:47Z" } diff --git a/docs/docs/en/release.md b/docs/docs/en/release.md index 87cf981708..abfa570024 100644 --- a/docs/docs/en/release.md +++ b/docs/docs/en/release.md @@ -12,6 +12,28 @@ hide: --- # Release Notes +## 0.5.26 + +### What's Changed + +This it the official **Python 3.13** support! Now, **FastStream** works (and tested) at **Python 3.8 - 3.13** versions! + +Warning: **Python3.8** is EOF since **3.13** release and we plan to drop it support in **FastStream 0.6.0** version. + +Also, current release has little bugfixes related to **CLI** and **AsyncAPI** schema. + +* fix: asgi docs by [@Sehat1137](https://github.com/Sehat1137){.external-link target="_blank"} in [#1828](https://github.com/airtai/faststream/pull/1828){.external-link target="_blank"} +* docs: add link to RU TG community by [@Lancetnik](https://github.com/Lancetnik){.external-link target="_blank"} in [#1831](https://github.com/airtai/faststream/pull/1831){.external-link target="_blank"} +* docs: add dynaconf NATS HowTo example by [@sheldygg](https://github.com/sheldygg){.external-link target="_blank"} in [#1832](https://github.com/airtai/faststream/pull/1832){.external-link target="_blank"} +* Fix AsyncAPI 2.6.0 operation label by [@KrySeyt](https://github.com/KrySeyt){.external-link target="_blank"} in [#1835](https://github.com/airtai/faststream/pull/1835){.external-link target="_blank"} +* fix: correct CLI factory behavior by [@Lancetnik](https://github.com/Lancetnik){.external-link target="_blank"} in [#1838](https://github.com/airtai/faststream/pull/1838){.external-link target="_blank"} +* Autocommit precommit changes by [@kumaranvpl](https://github.com/kumaranvpl){.external-link target="_blank"} in [#1840](https://github.com/airtai/faststream/pull/1840){.external-link target="_blank"} +* Add devcontainers supporting all the brokers by [@kumaranvpl](https://github.com/kumaranvpl){.external-link target="_blank"} in [#1839](https://github.com/airtai/faststream/pull/1839){.external-link target="_blank"} +* Replace async Event with bool by [@Olegt0rr](https://github.com/Olegt0rr){.external-link target="_blank"} in [#1846](https://github.com/airtai/faststream/pull/1846){.external-link target="_blank"} +* Add support for Python 3.13 by [@davorrunje](https://github.com/davorrunje){.external-link target="_blank"} in [#1845](https://github.com/airtai/faststream/pull/1845){.external-link target="_blank"} + +**Full Changelog**: [#0.5.25...0.5.26](https://github.com/airtai/faststream/compare/0.5.25...0.5.26){.external-link target="_blank"} + ## 0.5.25 ### What's Changed From 6bdea98ce6638e5bb0cb47d40aec4b98b5446b4c Mon Sep 17 00:00:00 2001 From: dotX12 <64792903+dotX12@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:33:07 +0300 Subject: [PATCH 4/7] fix: anyio major version parser (#1850) * fix: anyio major version parser * chore: bump version --------- Co-authored-by: Pastukhov Nikita --- faststream/__about__.py | 2 +- faststream/_compat.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/faststream/__about__.py b/faststream/__about__.py index 6bc5c9573f..a829efe0e2 100644 --- a/faststream/__about__.py +++ b/faststream/__about__.py @@ -1,5 +1,5 @@ """Simple and fast framework to create message brokers based microservices.""" -__version__ = "0.5.26" +__version__ = "0.5.27" SERVICE_NAME = f"faststream-{__version__}" diff --git a/faststream/_compat.py b/faststream/_compat.py index e605f64ece..08c150d382 100644 --- a/faststream/_compat.py +++ b/faststream/_compat.py @@ -150,7 +150,7 @@ def with_info_plain_validator_function( # type: ignore[misc] return {} -anyio_major, *_ = map(int, get_version("anyio").split(".")) +anyio_major = int(get_version("anyio").split(".")[0]) ANYIO_V3 = anyio_major == 3 From e9246d889c243e0848888fd3f788fa1bb5057de3 Mon Sep 17 00:00:00 2001 From: "airt-release-notes-updater[bot]" <153718812+airt-release-notes-updater[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 04:57:04 +0000 Subject: [PATCH 5/7] Update Release Notes for 0.5.27 (#1851) * Update Release Notes for 0.5.27 * Update secrets --------- Co-authored-by: Lancetnik <44573917+Lancetnik@users.noreply.github.com> Co-authored-by: Kumaran Rajendhiran --- .secrets.baseline | 4 ++-- docs/docs/en/release.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 88df582f08..7964330ac3 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -153,7 +153,7 @@ "filename": "docs/docs/en/release.md", "hashed_secret": "35675e68f4b5af7b995d9205ad0fc43842f16450", "is_verified": false, - "line_number": 1745, + "line_number": 1756, "is_secret": false } ], @@ -178,5 +178,5 @@ } ] }, - "generated_at": "2024-10-12T18:42:47Z" + "generated_at": "2024-10-15T04:48:28Z" } diff --git a/docs/docs/en/release.md b/docs/docs/en/release.md index abfa570024..a6e1c4855c 100644 --- a/docs/docs/en/release.md +++ b/docs/docs/en/release.md @@ -12,6 +12,17 @@ hide: --- # Release Notes +## 0.5.27 + +### What's Changed + +* fix: anyio major version parser by [@dotX12](https://github.com/dotX12){.external-link target="_blank"} in [#1850](https://github.com/airtai/faststream/pull/1850){.external-link target="_blank"} + +### New Contributors +* [@dotX12](https://github.com/dotX12){.external-link target="_blank"} made their first contribution in [#1850](https://github.com/airtai/faststream/pull/1850){.external-link target="_blank"} + +**Full Changelog**: [#0.5.26...0.5.27](https://github.com/airtai/faststream/compare/0.5.26...0.5.27){.external-link target="_blank"} + ## 0.5.26 ### What's Changed From 89103746793c52a7cf46317e8ec58140dd2e731f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 23:13:51 +0300 Subject: [PATCH 6/7] chore(deps): bump the pip group with 8 updates (#1848) * chore(deps): bump the pip group with 8 updates Bumps the pip group with 8 updates: | Package | From | To | | --- | --- | --- | | [mkdocs-material](https://github.com/squidfunk/mkdocs-material) | `9.5.39` | `9.5.40` | | [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings) | `0.26.1` | `0.26.2` | | [mkdocs-macros-plugin](https://github.com/fralau/mkdocs_macros_plugin) | `1.2.0` | `1.3.5` | | [mypy](https://github.com/python/mypy) | `1.11.2` | `1.12.0` | | [semgrep](https://github.com/returntocorp/semgrep) | `1.90.0` | `1.91.0` | | [coverage[toml]](https://github.com/nedbat/coveragepy) | `7.6.1` | `7.6.3` | | [fastapi](https://github.com/fastapi/fastapi) | `0.115.0` | `0.115.2` | | [pre-commit](https://github.com/pre-commit/pre-commit) | `4.0.0` | `4.0.1` | Updates `mkdocs-material` from 9.5.39 to 9.5.40 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.39...9.5.40) Updates `mkdocstrings[python]` from 0.26.1 to 0.26.2 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/mkdocstrings/compare/0.26.1...0.26.2) Updates `mkdocs-macros-plugin` from 1.2.0 to 1.3.5 - [Release notes](https://github.com/fralau/mkdocs_macros_plugin/releases) - [Changelog](https://github.com/fralau/mkdocs-macros-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/fralau/mkdocs_macros_plugin/compare/v1.2.0...v1.3.5) Updates `mypy` from 1.11.2 to 1.12.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.11.2...v1.12.0) Updates `semgrep` from 1.90.0 to 1.91.0 - [Release notes](https://github.com/returntocorp/semgrep/releases) - [Changelog](https://github.com/semgrep/semgrep/blob/develop/CHANGELOG.md) - [Commits](https://github.com/returntocorp/semgrep/compare/v1.90.0...v1.91.0) Updates `coverage[toml]` from 7.6.1 to 7.6.3 - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.1...7.6.3) Updates `fastapi` from 0.115.0 to 0.115.2 - [Release notes](https://github.com/fastapi/fastapi/releases) - [Commits](https://github.com/fastapi/fastapi/compare/0.115.0...0.115.2) Updates `pre-commit` from 4.0.0 to 4.0.1 - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v4.0.0...v4.0.1) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: mkdocstrings[python] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: mkdocs-macros-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: semgrep dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: coverage[toml] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: fastapi dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip ... Signed-off-by: dependabot[bot] * chore: fix errors * chore: fix coverage version --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kumaran Rajendhiran Co-authored-by: Nikita Pastukhov --- faststream/utils/functions.py | 2 +- pyproject.toml | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/faststream/utils/functions.py b/faststream/utils/functions.py index 453c70ffc7..685ab7da90 100644 --- a/faststream/utils/functions.py +++ b/faststream/utils/functions.py @@ -60,7 +60,7 @@ def timeout_scope( raise_timeout: bool = False, ) -> ContextManager[anyio.CancelScope]: scope: Callable[[Optional[float]], ContextManager[anyio.CancelScope]] - scope = anyio.fail_after if raise_timeout else anyio.move_on_after # type: ignore[assignment] + scope = anyio.fail_after if raise_timeout else anyio.move_on_after return scope(timeout) diff --git a/pyproject.toml b/pyproject.toml index 9c070bc318..10d7a66092 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,15 +87,15 @@ cli = [ optionals = ["faststream[rabbit,kafka,confluent,nats,redis,otel,cli]"] devdocs = [ - "mkdocs-material==9.5.39", + "mkdocs-material==9.5.40", "mkdocs-static-i18n==1.2.3", "mdx-include==1.4.2", - "mkdocstrings[python]==0.26.1", + "mkdocstrings[python]==0.26.2", "mkdocs-literate-nav==0.6.1", "mkdocs-git-revision-date-localized-plugin==1.2.9", "mike==2.1.3", # versioning "mkdocs-minify-plugin==0.8.0", - "mkdocs-macros-plugin==1.2.0", # includes with variables + "mkdocs-macros-plugin==1.3.5", # includes with variables "mkdocs-glightbox==0.4.0", # img zoom "pillow", # required for mkdocs-glightbo "cairosvg", # required for mkdocs-glightbo @@ -104,7 +104,7 @@ devdocs = [ types = [ "faststream[optionals]", - "mypy==1.11.2", + "mypy==1.12.0", # mypy extensions "types-Deprecated", "types-PyYAML", @@ -120,12 +120,13 @@ lint = [ "faststream[types]", "ruff==0.6.9", "bandit==1.7.10", - "semgrep==1.90.0", + "semgrep==1.91.0", "codespell==2.3.0", ] test-core = [ - "coverage[toml]==7.6.1", + "coverage[toml]==7.6.1; python_version == '3.8'", + "coverage[toml]==7.6.3; python_version >= '3.9'", "pytest==8.3.3", "pytest-asyncio==0.24.0", "dirty-equals==0.8.0", @@ -134,7 +135,7 @@ test-core = [ testing = [ "faststream[test-core]", - "fastapi==0.115.0", + "fastapi==0.115.2", "pydantic-settings>=2.0.0,<3.0.0", "httpx==0.27.2", "PyYAML==6.0.2", @@ -144,7 +145,7 @@ testing = [ dev = [ "faststream[optionals,lint,testing,devdocs]", "pre-commit==3.5.0; python_version < '3.9'", - "pre-commit==4.0.0; python_version >= '3.9'", + "pre-commit==4.0.1; python_version >= '3.9'", "detect-secrets==1.5.0", ] From 8524b7f58d4ad6136dbc3ecfb3495f0b4e70b40c Mon Sep 17 00:00:00 2001 From: Tim Hutchinson Date: Wed, 16 Oct 2024 13:46:51 -0400 Subject: [PATCH 7/7] docs: Correct minimum FastAPI version for lifespan handling (#1853) --- docs/docs/en/getting-started/integrations/fastapi/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/en/getting-started/integrations/fastapi/index.md b/docs/docs/en/getting-started/integrations/fastapi/index.md index 9ece2eab5e..c020dfcb5d 100644 --- a/docs/docs/en/getting-started/integrations/fastapi/index.md +++ b/docs/docs/en/getting-started/integrations/fastapi/index.md @@ -27,7 +27,7 @@ Just import a **StreamRouter** you need and declare the message handler in the s {! includes/getting_started/integrations/fastapi/1.md !} !!! warning - If you are using **fastapi < 0.102.2** version, you should setup lifespan manually `#!python FastAPI(lifespan=router.lifespan_context)` + If you are using **fastapi < 0.112.2** version, you should setup lifespan manually `#!python FastAPI(lifespan=router.lifespan_context)` When processing a message from a broker, the entire message body is placed simultaneously in both the `body` and `path` request parameters. You can access them in any way convenient for you. The message header is placed in `headers`.