Skip to content

Commit f5ea854

Browse files
author
zhansheng.lzs
committed
fix(packaging): keep typer/rich in core deps for the classic CLI
Existing users and integration tests run `dashscope` subcommands (e.g. oss.upload) after a plain install, so typer/rich must stay core deps. Drop the [cli] extra and the import guard; acli and rl deps remain optional extras.
1 parent 9f96035 commit f5ea854

5 files changed

Lines changed: 8 additions & 24 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ To install the DashScope Python SDK, simply run:
1414
pip install dashscope
1515
```
1616

17-
The base install covers SDK API calls only. Optional feature groups are
18-
available as extras:
17+
The base install covers SDK API calls and the `dashscope` CLI command.
18+
Optional feature groups are available as extras:
1919

2020
| Extra | Provides | Install |
2121
|-------|----------|---------|
22-
| `cli` | `dashscope` command subcommands (generation, files, ...) | `pip install "dashscope[cli]"` |
2322
| `acli` | Interactive AI assistant (DashScope SDK Expert) | `pip install "dashscope[acli]"` |
2423
| `rl` | Agentic RL fine-tuning | `pip install "dashscope[rl]"` |
2524
| `tokenizer` | Local tokenizer without downloads | `pip install "dashscope[tokenizer]"` |

‎README_zh.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ DashScope Python SDK 提供了访问[阿里云百炼(Model Studio)](https://
1515
pip install dashscope
1616
```
1717

18-
基础安装仅包含 SDK API 调用。可选功能组通过 extras 安装:
18+
基础安装包含 SDK API 调用和 `dashscope` CLI 命令。可选功能组通过 extras 安装:
1919

2020
| Extra | 提供的能力 | 安装命令 |
2121
|-------|----------|---------|
22-
| `cli` | `dashscope` 命令子命令(generation、files 等) | `pip install "dashscope[cli]"` |
23-
| `acli` | 交互式 AI 助手(DashScope SDK Expert) | `pip install "dashscope[acli]"` |
22+
| `acli` | 交互式 AI 助手(DashScope SDK Expert) | `pip install "dashscope[acli]"` |
2423
| `rl` | Agentic RL 微调 | `pip install "dashscope[rl]"` |
2524
| `tokenizer` | 本地 tokenizer(无需下载) | `pip install "dashscope[tokenizer]"` |
2625

‎dashscope/cli/__init__.py‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@
1717
category=Warning,
1818
)
1919

20-
try:
21-
import typer # noqa: E402
22-
except ImportError as _cli_dep_err: # noqa: E402
23-
raise ImportError(
24-
"The `dashscope` command needs optional dependencies. "
25-
"Install them with: pip install 'dashscope[cli]' "
26-
"(or 'dashscope[acli]' for the interactive assistant)",
27-
) from _cli_dep_err
20+
import typer # noqa: E402
2821

2922
import dashscope # noqa: E402
3023
from dashscope.cli.common import err_console # noqa: E402

‎requirements.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ requests
33
websocket-client
44
cryptography
55
certifi
6+
typer>=0.9.0
7+
rich>=13.0.0
68
httpx>=0.25.0
79
httpx-sse>=0.4.0

‎setup.py‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,8 @@ def readme():
6767
include_package_data=True,
6868
extras_require={
6969
"tokenizer": ["tiktoken"],
70-
# Classic `dashscope` CLI subcommands (generation, files, ...)
71-
"cli": [
72-
"typer>=0.9.0",
73-
"rich>=13.0.0",
74-
],
75-
# Interactive AI assistant (dashscope.acli), includes the cli extra
70+
# Interactive AI assistant (dashscope.acli); typer/rich are core deps
7671
"acli": [
77-
"typer>=0.9.0",
78-
"rich>=13.0.0",
7972
"prompt-toolkit>=3.0",
8073
"textual>=0.50",
8174
"PyYAML>=6.0",
@@ -86,8 +79,6 @@ def readme():
8679
"acli-voice": ["sounddevice>=0.4", "numpy>=1.20"],
8780
"acli-camera": ["opencv-python>=4.5"],
8881
"acli-all": [
89-
"typer>=0.9.0",
90-
"rich>=13.0.0",
9182
"prompt-toolkit>=3.0",
9283
"textual>=0.50",
9384
"PyYAML>=6.0",

0 commit comments

Comments
 (0)