带有所有附加功能的“pip install”

Jen*_*sun 5 python pip setuptools

一个pip install有所有额外功能的怎么办?我知道做这样的事情:

pip install -e .[docs,tests,others]
Run Code Online (Sandbox Code Playgroud)

是一种选择。但是,是否可以执行以下操作:

pip install -e .[all]
Run Code Online (Sandbox Code Playgroud)

这个问题类似于setup.py/setup.cfg install all extras。但是,那里的答案要求setup.cfg编辑该文件。是否有可能做到这一点无需修改setup.pysetup.cfg

phd*_*phd 6

是否可以在不修改 setup.py 或 setup.cfg 的情况下[安装所有附加功能]?

直到包的作者在 setup.py 中声明了所有附加项。就像是

docs = […]
tests = […]
others = […]
all = docs + tests + others

setup(
    …,
    extras_require = {
        'all': all,
        'docs': docs,
        'tests': tests,
        'others': others,
    },
    …,
)
Run Code Online (Sandbox Code Playgroud)