他のライブラリに依存するライブラリを作成しました。ただし、必要なもの (サーバーのバッチ処理など) とオプションの依存関係 (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
)