推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
SystemLight
V2EX  ›  Python

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

  •  
  •   SystemLight ·
    SystemLight · Sep 16, 2021 · 2358 views
    This topic created in 1699 days ago, the information mentioned may be changed or developed.
    • 看过许多开源库,可以安装不同的版本
    • 如何向开源库这样根据方括号中不同标签安装不同依赖版 fastapi[all],uvicorn[standard]
    5 replies    2021-09-19 12:20:22 +08:00
    2i2Re2PLMaDnghL
        2
    2i2Re2PLMaDnghL  
       Sep 16, 2021
    不是不同版本,这是额外依赖
    你可以安装完了再手动把那些额外依赖也一并装上,效果是一样的。

    实际运行中通过代码进行依赖回落,比如 try: import a_faster_json as json except: import json
    ClericPy
        3
    ClericPy  
       Sep 16, 2021
    其实我更好奇的是有没有什么 tag 是让我只用某些依赖的...

    比如 fastapi[pure] 只安装 fastapi 自己源码不带依赖这样子... 或者 pip 的参数也行, 主要有的库里用了我不想用的依赖, 我用同样的标准给它替换掉了, 但是被替掉那个却不得不装在旁边不被使用
    julyclyde
        4
    julyclyde  
       Sep 18, 2021
    @ClericPy monkey patch
    zeroxia
        5
    zeroxia  
       Sep 19, 2021
    为啥我装了 fastapi[all] 还要再安卓 aiofiles ?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   979 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 22:01 · PVG 06:01 · LAX 15:01 · JFK 18:01
    ♥ Do have faith in what you're doing.