pip是否可以处理来自setuptools/distribute来源的extras_requires? [英] Does pip handle extras_requires from setuptools/distribute based sources?
问题描述
我拥有带有setup.py和 extras_requires 行如下:
I have package "A" with a setup.py and an extras_requires line like:
extras_require = {
'ssh': ['paramiko'],
},
还有一个依赖于util的程序包"B":
And a package "B" that depends on util:
install_requires = ['A[ssh]']
如果我在软件包B上运行python setup.py install
,该软件包在后台使用了setuptools.command.easy_install
,则extras_requires
已正确解析,并且已安装paramiko.
If I run python setup.py install
on package B, which uses setuptools.command.easy_install
under the hood, the extras_requires
is correctly resolved, and paramiko is installed.
但是,如果我运行pip /path/to/B
或pip hxxp://.../b-version.tar.gz
,则安装了软件包A,但没有安装paramiko.
However, if I run pip /path/to/B
or pip hxxp://.../b-version.tar.gz
, package A is installed, but paramiko is not.
因为pip是从源代码安装",所以我不确定为什么它不起作用.它应该先调用B的setup.py,然后解析&安装B和A的依赖项.
Because pip "installs from source", I'm not quite sure why this isn't working. It should be invoking the setup.py of B, then resolving & installing dependencies of both B and A.
pip可以吗?
推荐答案
此功能自2012年2月(问了该问题一年后)发布的pip 1.1之后就被支持.
This is suppported since pip 1.1, which was released in February 2012 (one year after this question was asked).
这篇关于pip是否可以处理来自setuptools/distribute来源的extras_requires?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!