diff --git a/.github/workflows/pr_tests.yaml b/.github/workflows/pr_tests.yaml index e93d7d9feb..c610868a84 100644 --- a/.github/workflows/pr_tests.yaml +++ b/.github/workflows/pr_tests.yaml @@ -140,7 +140,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: | python -m pip install uv - uv pip install --system .[kafka,test-core] + uv pip install --system .[kafka,test-core,cli] - name: Test run: > bash scripts/test.sh @@ -209,7 +209,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: | python -m pip install uv - uv pip install --system .[confluent,test-core] + uv pip install --system .[confluent,test-core,cli] - name: Test run: > bash scripts/test.sh @@ -278,7 +278,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: | python -m pip install uv - uv pip install --system .[rabbit,test-core] + uv pip install --system .[rabbit,test-core,cli] - name: Test run: > bash scripts/test.sh @@ -336,7 +336,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: | python -m pip install uv - uv pip install --system .[nats,test-core] + uv pip install --system .[nats,test-core,cli] - name: Test run: > bash scripts/test.sh @@ -394,7 +394,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: | python -m pip install uv - uv pip install --system .[redis,test-core] + uv pip install --system .[redis,test-core,cli] - name: Test run: > bash scripts/test.sh diff --git a/README.md b/README.md index b9b44ca300..268bbc3794 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,12 @@ async def test_invalid(): The application can be started using built-in **FastStream** CLI command. +Before running the service, install **FastStream CLI** using the following command: + +```shell +pip install "faststream[cli]" +``` + To run the service, use the **FastStream CLI** command and pass the module (in this case, the file where the app implementation is located) and the app symbol to the command. ``` shell diff --git a/docs/docs/SUMMARY.md b/docs/docs/SUMMARY.md index 9c3931f316..a8df897c64 100644 --- a/docs/docs/SUMMARY.md +++ b/docs/docs/SUMMARY.md @@ -41,7 +41,7 @@ search: - [HTTP Async Frameworks](getting-started/integrations/frameworks/index.md) - [FastAPI Plugin](getting-started/integrations/fastapi/index.md) - [Django](getting-started/integrations/django/index.md) - - [CLI commands](getting-started/cli/index.md) + - [CLI](getting-started/cli/index.md) - [ASGI](getting-started/asgi.md) - [OpenTelemetry](getting-started/opentelemetry/index.md) - [Logging](getting-started/logging.md) diff --git a/docs/docs/en/faststream.md b/docs/docs/en/faststream.md index 1f04e11edd..642bd69484 100644 --- a/docs/docs/en/faststream.md +++ b/docs/docs/en/faststream.md @@ -141,6 +141,12 @@ Using pytest, the test for our service would look like this: The application can be started using the built-in **FastStream** CLI command. +!!! note + Before running the service, install **FastStream CLI** using the following command: + ```shell + pip install "faststream[cli]" + ``` + To run the service, use the **FastStream CLI** command and pass the module (in this case, the file where the app implementation is located) and the app symbol to the command. ```shell diff --git a/docs/docs/en/getting-started/cli/index.md b/docs/docs/en/getting-started/cli/index.md index 6d9cdce471..64bb4d7f98 100644 --- a/docs/docs/en/getting-started/cli/index.md +++ b/docs/docs/en/getting-started/cli/index.md @@ -15,6 +15,16 @@ search: !!! quote "" Thanks to [*typer*](https://typer.tiangolo.com/){.external-link target="_blank"} and [*watchfiles*](https://watchfiles.helpmanual.io/){.external-link target="_blank"}. Their work is the basis of this tool. +## Installation + +To install the **FastStream CLI**, you need to run the following command: + +```shell +pip install faststream[cli] +``` + +After installation, you can check which commands are available by executing: + ```shell faststream --help ``` diff --git a/docs/docs/en/getting-started/index.md b/docs/docs/en/getting-started/index.md index 2ee7cb7eef..4d4248193c 100644 --- a/docs/docs/en/getting-started/index.md +++ b/docs/docs/en/getting-started/index.md @@ -20,6 +20,12 @@ Install using `pip`: ## Basic Usage +!!! note + Before continuing with the next steps, make sure you install *Fastream* CLI. + ```shell + pip install "faststream[cli]" + ``` + To create a basic application, add the following code to a new file (e.g. `serve.py`): {! includes/getting_started/index/base.md !} diff --git a/docs/docs/navigation_template.txt b/docs/docs/navigation_template.txt index 193b6a29c6..7fe1a7ac56 100644 --- a/docs/docs/navigation_template.txt +++ b/docs/docs/navigation_template.txt @@ -41,7 +41,7 @@ search: - [HTTP Async Frameworks](getting-started/integrations/frameworks/index.md) - [FastAPI Plugin](getting-started/integrations/fastapi/index.md) - [Django](getting-started/integrations/django/index.md) - - [CLI commands](getting-started/cli/index.md) + - [CLI](getting-started/cli/index.md) - [ASGI](getting-started/asgi.md) - [OpenTelemetry](getting-started/opentelemetry/index.md) - [Logging](getting-started/logging.md) diff --git a/faststream/__about__.py b/faststream/__about__.py index f773a18c49..df40fc6c6a 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.22" +__version__ = "0.5.23" SERVICE_NAME = f"faststream-{__version__}" diff --git a/pyproject.toml b/pyproject.toml index 198f69b03f..e92057e7c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,6 @@ dynamic = ["version"] dependencies = [ "anyio>=3.7.1,<5", "fast-depends>=2.4.0b0,<3.0.0", - "typer>=0.9,!=0.12,<1", "typing-extensions>=4.8.0", ] @@ -75,8 +74,13 @@ redis = ["redis>=5.0.0,<6.0.0"] otel = ["opentelemetry-sdk>=1.24.0,<2.0.0"] +cli = [ + "typer>=0.9,!=0.12,<1", + "watchfiles>=0.15.0,<0.25.0" +] + # dev dependencies -optionals = ["faststream[rabbit,kafka,confluent,nats,redis,otel]"] +optionals = ["faststream[rabbit,kafka,confluent,nats,redis,otel,cli]"] devdocs = [ "mkdocs-material==9.5.34", @@ -130,7 +134,6 @@ testing = [ "pydantic-settings>=2.0.0,<3.0.0", "httpx==0.27.2", "PyYAML==6.0.2", - "watchfiles==0.24.0", "email-validator==2.2.0", ]