pip install -e svn+ssh 不要带用户



如果我这样做:

svn co svn+ssh://svn@10.210.1.24/cidb/V1/trunk/config cidb_config_pipenv

它有效,但如果我这样做:

pip install -e svn+ssh://svn@10.210.1.24/cidb/V1/trunk/config#egg=cidb_config_pipenv
Obtaining cidb_config_pipenv from svn+ssh://svn@10.210.1.24/cidb/V1/trunk/config#egg=cidb_config_pipenv

它剥离了"svn@":

Checking out svn+ssh://10.210.1.24/cidb/V1/trunk/config to /root/.virtualenvs/root-PB1MQnVC/src/cidb-config-pipenv

因此,它尝试使用"svn"以外的其他用户登录svn服务器,但失败了。

在pip文档中,我看到可以使用svn + ssh,但没有示例:我有正确的语法来指定用于登录svn服务器的用户吗?

编辑:我找到的唯一解决方案是在~/.subversion/config中的SSH隧道定义中强制用户名:

[tunnels]
ssh = ssh -l svn

这真的很丑,但它有效。

当进入详细模式时,可以看到 pip 正在使用 --username 调用 svn checkout。但那是SVN,它不是工作。

svn checkout --username myuser svn+ssh://host/path

不起作用(至少在 Ubuntu 和 CentOS 上(:用户名不被考虑在内。SVN只接受:

svn checkout svn+ssh://myuser@host/path

我发现的技巧:使用"%40"而不是"@",这样 pip 就不会检测到 url 中的用户名,也不会使用 --username 选项调用 svn。 所以现在我可以做:

pip -e svn+ssh://myuser%40host/path#egg=myproject

这很丑陋,可能是我必须为 pip 和/或 svn 打开一个问题......

>svn+ssh使用不同的(ssh(身份验证,因此正常的--username身份验证不起作用。为了避免pip--username传递给svn您必须避免在URL中svn@。要传递正确的 ssh 密钥,您必须重新定义 ssh 命令。像这样的东西(提供真正密钥的路径(:

SVN_SSH="ssh -i $HOME/.ssh/id_dsa.svn"

在您的情况下,它可能是

SVN_SSH="ssh -l svn"
export SVN_SSH

验证它是否有效:

svn co svn+ssh://10.210.1.24/cidb/V1/trunk/config cidb_config_pipenv

运行点:

pip install -e svn+ssh://10.210.1.24/cidb/V1/trunk/config#egg=cidb_config_pipenv

最新更新