Skip to content

Commit

Permalink
build(#1430): separate cli faststream to its own distribution (#1769)
Browse files Browse the repository at this point in the history
* build(#1430): separate cli faststream to its own distribution

* ci: add cli target to smoke job tests

* docs: mentioned fastream cli distribution on documnetation and README

* Update faststream.md

* chore: restrict watchfiles version

* chore: bump version

---------

Co-authored-by: Kumaran Rajendhiran <[email protected]>
Co-authored-by: Pastukhov Nikita <[email protected]>
Co-authored-by: Nikita Pastukhov <[email protected]>
  • Loading branch information
4 people committed Sep 9, 2024
1 parent eb6b873 commit 521eaf2
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pr_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/en/faststream.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions docs/docs/en/getting-started/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/en/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 !}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/navigation_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion faststream/__about__.py
Original file line number Diff line number Diff line change
@@ -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__}"
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand All @@ -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",
Expand Down Expand Up @@ -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",
]

Expand Down

0 comments on commit 521eaf2

Please sign in to comment.