8

Python 发布包时如何标记 tag,类似 pip install fastapi[all] ?

 3 years ago
source link: https://www.v2ex.com/t/802255
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Python

Python 发布包时如何标记 tag,类似 pip install fastapi[all] ?

  SystemLight · SystemLight · 13 小时 12 分钟前 · 290 次点击
  • 看过许多开源库,可以安装不同的版本
  • 如何向开源库这样根据方括号中不同标签安装不同依赖版 fastapi[all],uvicorn[standard]
3 条回复    2021-09-16 22:13:48 +08:00

2i2Re2PLMaDnghL

2i2Re2PLMaDnghL   12 小时 46 分钟前

不是不同版本,这是额外依赖
你可以安装完了再手动把那些额外依赖也一并装上,效果是一样的。

实际运行中通过代码进行依赖回落,比如 try: import a_faster_json as json except: import json

ClericPy

ClericPy   2 小时 53 分钟前

其实我更好奇的是有没有什么 tag 是让我只用某些依赖的...

比如 fastapi[pure] 只安装 fastapi 自己源码不带依赖这样子... 或者 pip 的参数也行, 主要有的库里用了我不想用的依赖, 我用同样的标准给它替换掉了, 但是被替掉那个却不得不装在旁边不被使用

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK