Skip to content

Commit 521eaf2

Browse files
RubenRibGarciakumaranvplLancetnik
authored
build(#1430): separate cli faststream to its own distribution (#1769)
* 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 <kumaran@airt.ai> Co-authored-by: Pastukhov Nikita <nikita@pastukhov-dev.ru> Co-authored-by: Nikita Pastukhov <diementros@yandex.ru>
1 parent eb6b873 commit 521eaf2

File tree

9 files changed

+42
-11
lines changed

9 files changed

+42
-11
lines changed

.github/workflows/pr_tests.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
if: steps.cache.outputs.cache-hit != 'true'
141141
run: |
142142
python -m pip install uv
143-
uv pip install --system .[kafka,test-core]
143+
uv pip install --system .[kafka,test-core,cli]
144144
- name: Test
145145
run: >
146146
bash scripts/test.sh
@@ -209,7 +209,7 @@ jobs:
209209
if: steps.cache.outputs.cache-hit != 'true'
210210
run: |
211211
python -m pip install uv
212-
uv pip install --system .[confluent,test-core]
212+
uv pip install --system .[confluent,test-core,cli]
213213
- name: Test
214214
run: >
215215
bash scripts/test.sh
@@ -278,7 +278,7 @@ jobs:
278278
if: steps.cache.outputs.cache-hit != 'true'
279279
run: |
280280
python -m pip install uv
281-
uv pip install --system .[rabbit,test-core]
281+
uv pip install --system .[rabbit,test-core,cli]
282282
- name: Test
283283
run: >
284284
bash scripts/test.sh
@@ -336,7 +336,7 @@ jobs:
336336
if: steps.cache.outputs.cache-hit != 'true'
337337
run: |
338338
python -m pip install uv
339-
uv pip install --system .[nats,test-core]
339+
uv pip install --system .[nats,test-core,cli]
340340
- name: Test
341341
run: >
342342
bash scripts/test.sh
@@ -394,7 +394,7 @@ jobs:
394394
if: steps.cache.outputs.cache-hit != 'true'
395395
run: |
396396
python -m pip install uv
397-
uv pip install --system .[redis,test-core]
397+
uv pip install --system .[redis,test-core,cli]
398398
- name: Test
399399
run: >
400400
bash scripts/test.sh

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ async def test_invalid():
200200

201201
The application can be started using built-in **FastStream** CLI command.
202202

203+
Before running the service, install **FastStream CLI** using the following command:
204+
205+
```shell
206+
pip install "faststream[cli]"
207+
```
208+
203209
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.
204210

205211
``` shell

docs/docs/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ search:
4141
- [HTTP Async Frameworks](getting-started/integrations/frameworks/index.md)
4242
- [FastAPI Plugin](getting-started/integrations/fastapi/index.md)
4343
- [Django](getting-started/integrations/django/index.md)
44-
- [CLI commands](getting-started/cli/index.md)
44+
- [CLI](getting-started/cli/index.md)
4545
- [ASGI](getting-started/asgi.md)
4646
- [OpenTelemetry](getting-started/opentelemetry/index.md)
4747
- [Logging](getting-started/logging.md)

docs/docs/en/faststream.md

+6
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ Using pytest, the test for our service would look like this:
141141

142142
The application can be started using the built-in **FastStream** CLI command.
143143

144+
!!! note
145+
Before running the service, install **FastStream CLI** using the following command:
146+
```shell
147+
pip install "faststream[cli]"
148+
```
149+
144150
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.
145151

146152
```shell

docs/docs/en/getting-started/cli/index.md

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ search:
1515
!!! quote ""
1616
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.
1717

18+
## Installation
19+
20+
To install the **FastStream CLI**, you need to run the following command:
21+
22+
```shell
23+
pip install faststream[cli]
24+
```
25+
26+
After installation, you can check which commands are available by executing:
27+
1828
```shell
1929
faststream --help
2030
```

docs/docs/en/getting-started/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ Install using `pip`:
2020

2121
## Basic Usage
2222

23+
!!! note
24+
Before continuing with the next steps, make sure you install *Fastream* CLI.
25+
```shell
26+
pip install "faststream[cli]"
27+
```
28+
2329
To create a basic application, add the following code to a new file (e.g. `serve.py`):
2430

2531
{! includes/getting_started/index/base.md !}

docs/docs/navigation_template.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ search:
4141
- [HTTP Async Frameworks](getting-started/integrations/frameworks/index.md)
4242
- [FastAPI Plugin](getting-started/integrations/fastapi/index.md)
4343
- [Django](getting-started/integrations/django/index.md)
44-
- [CLI commands](getting-started/cli/index.md)
44+
- [CLI](getting-started/cli/index.md)
4545
- [ASGI](getting-started/asgi.md)
4646
- [OpenTelemetry](getting-started/opentelemetry/index.md)
4747
- [Logging](getting-started/logging.md)

faststream/__about__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Simple and fast framework to create message brokers based microservices."""
22

3-
__version__ = "0.5.22"
3+
__version__ = "0.5.23"
44

55
SERVICE_NAME = f"faststream-{__version__}"

pyproject.toml

+6-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ dynamic = ["version"]
5757
dependencies = [
5858
"anyio>=3.7.1,<5",
5959
"fast-depends>=2.4.0b0,<3.0.0",
60-
"typer>=0.9,!=0.12,<1",
6160
"typing-extensions>=4.8.0",
6261
]
6362

@@ -75,8 +74,13 @@ redis = ["redis>=5.0.0,<6.0.0"]
7574

7675
otel = ["opentelemetry-sdk>=1.24.0,<2.0.0"]
7776

77+
cli = [
78+
"typer>=0.9,!=0.12,<1",
79+
"watchfiles>=0.15.0,<0.25.0"
80+
]
81+
7882
# dev dependencies
79-
optionals = ["faststream[rabbit,kafka,confluent,nats,redis,otel]"]
83+
optionals = ["faststream[rabbit,kafka,confluent,nats,redis,otel,cli]"]
8084

8185
devdocs = [
8286
"mkdocs-material==9.5.34",
@@ -130,7 +134,6 @@ testing = [
130134
"pydantic-settings>=2.0.0,<3.0.0",
131135
"httpx==0.27.2",
132136
"PyYAML==6.0.2",
133-
"watchfiles==0.24.0",
134137
"email-validator==2.2.0",
135138
]
136139

0 commit comments

Comments
 (0)