这是我的 setup.py:
setup(
...
install_requires=['GEDThriftStubs'],
dependency_links=['git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs'],
...)
然后我创建包:
python setup.py sdist
然后我尝试安装它:
pip install file://path/package-0.0.1.tar.gz
并在终端中得到这个:
Downloading/unpacking GEDThriftStubs (from package==0.0.1)
Could not find any downloads that satisfy the requirement GEDThriftStubs (from package==0.0.1)
No distributions at all found for GEDThriftStubs (from package==0.0.1)
在像这样的 pip.log 消息中:
Skipping link git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs; wrong project name (not gedthriftstubs)
而且我的项目中没有确切的名称“gedthriftstubs”,如果重要的话。
但这很好用:
pip install git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs