我们建立了一个依赖其他图书馆的图书馆。但是有必要(例如,对于服务器批处理)和可选的依赖关系(例如,对于带有GUI的客户机)。
可能是这样的吗:
pip install mylib.tar.gz # automatically downloads and installs with the minimal set of dependencies
pip install mylib.tar.gz --install-option="complete" # automatically installs with all dependencies
我已经找到了extra_require
标志,但是如何告诉pip
使用它们呢?setup.py
看起来如下:
from setuptools import setup
# ...
# Hard library depencencies:
requires = [
"numpy>=1.4.1",
"scipy>=0.7.2",
"traits>=3.4.0"
]
# Soft library dependencies:
recommended = {
"mpl": ["matplotlib>=0.99.3"],
"bn": ["bottleneck>=0.6"]
}
# ...
# Installer parameters:
setup(
name = "mylib",
#...
install_requires = requires,
extras_require = recommended
)
目前没有回答
相关问题 更多 >
编程相关推荐