从本地SVN签出安装pip包

时间:2011-04-13 10:57:22

标签: python svn package pip

我的svn存储库中有另一个python项目(有一个setup.py等)的克隆。我想从这个目录安装tell pip来安装。但是它是一个内部的svn repo,可以通过svn://方案访问,而不是http://

我可以像svn co svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version ./foobar一样检查目录,然后使用pip:pip install foobar/进行安装,但我无法一次性完成。

这是我尝试过的和输出:

pip install svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
  File ".../virtualenv/lib/python2.5/site-packages/pip-0.7.2-py2.5.egg/pip/vcs/__init__.py", line 110, in get_url_rev
    url = self.url.split('+', 1)[1]
IndexError: list index out of range

pip install svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
File "...virtualenv/lib/python2.5/site-packages/distribute-0.6.10-py2.5.egg/pkg_resources.py", line 2424, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version', 'at', '+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version')

这两个问题都发生在URL末尾有#egg=packagename的情况下(带有相同的错误消息)。

以及可编辑的网址:

pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
Obtaining package from svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
  Checking out svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package to ../virtualenv/src/package
svn: URL 'svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package' is not properly URI-encoded

所以SVN会抱怨网址末尾有#egg=package,如果我将其删除,我会收到此错误:

pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
--editable=svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version is not the right format; it must have #egg=Package

如何使用pip从SVN链接安装软件包?

1 个答案:

答案 0 :(得分:3)

现在这是一个开放的bug。保罗·纳斯拉特(Paul Nasrat)正在研究并打开并发布。

关注https://github.com/pypa/pip/issues/252