Skip to content

Commit f9da68f

Browse files
feat: 添加可选依赖安装配置
1 parent 8fe938b commit f9da68f

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ test.py
44
/tsugu_api_python.egg-info/
55
/build/
66
/dist/
7-
/.venv/
7+
/.venv/
8+
requirements.txt

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ _✨ Python 编写的 [TsuguBanGDreamBot](https://github.com/Yamamoto-2/tsugu-ba
105105
$ pip3 install tsugu-api-python
106106
```
107107

108+
> 使用**可选依赖**安装可同时安装指定 HTTP 请求库
109+
>
110+
> ```bash
111+
> $ pip3 install tsugu-api-python[httpx] # 同时安装适配版本 httpx
112+
> $ pip3 install tsugu-api-python[aiohttp] # 同时安装适配版本 aiohttp
113+
> ```
114+
108115
使用如下代码,获取指定歌曲信息图片:
109116
110117
```python

setup.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='tsugu-api-python',
8-
version='1.5.6',
8+
version='1.5.7',
99
author='WindowsSov8',
1010
author_email='qwertyuiop2333@hotmail.com',
1111
description='Tsugu BanGDream Bot 的功能 API 统合包',
@@ -22,6 +22,14 @@
2222
],
2323
python_requires='>=3.8',
2424
install_requires=[
25-
'typing_extensions>=4.5.0'
26-
]
25+
'typing_extensions>=4.5.0',
26+
],
27+
extras_require={
28+
'httpx': [
29+
'httpx>=0.22.0',
30+
],
31+
'aiohttp': [
32+
'aiohttp>=3.8.1',
33+
],
34+
},
2735
)

0 commit comments

Comments
 (0)