如何将pip指向多变的分支?

2024-09-28 19:27:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图通过pip将我的应用程序安装到virtualenv进行测试。

可以很好地安装defaulttip,如下所示:

pip install -e hg+https://username@bitbucket.org/username/app_name#egg=app_name

但是有没有什么方法可以指向一个分支,而不仅仅是得到小费。不知道这是不是一个变化无常的东西,比特桶,还是皮普。

Bitbucket允许下载带标记的代码版本,但我只能在登录浏览器时才能使其正常工作。我尝试从tar.gz安装,如下所示:

pip install https://username@bitbucket.org/username/app_name/get/bbc4286a75db.tar.gz

但即使输入了我的密码,它也会未经授权返回401(这是一个私人回购)


Tags: installpipnamehttpsorgappdefaultbitbucket
1条回答
网友
1楼 · 发布于 2024-09-28 19:27:47

在第VCS Support节的正式pip文档中:

Mercurial

The supported schemes are: hg+http, hg+https, hg+static-http and hg+ssh:

-e hg+http://hg.myproject.org/MyProject/#egg=MyProject
-e hg+https://hg.myproject.org/MyProject/#egg=MyProject
-e hg+ssh://hg@myproject.org/MyProject/#egg=MyProject

You can also specify a revision number, a revision hash, a tag name or a local branch name:

-e hg+http://hg.myproject.org/MyProject/@da39a3ee5e6b#egg=MyProject
-e hg+http://hg.myproject.org/MyProject/@2019#egg=MyProject
-e hg+http://hg.myproject.org/MyProject/@v1.0#egg=MyProject
-e hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject

在命令行指定repo时语法相同

pip install -e hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject

而且它在不使用0.8.2版的-e选项starting时也能工作。

相关问题 更多 >