如何使用pip从Bitbucket安装软件包?

Ber*_*ire 21 python pip bitbucket

我正在制作一个需要指向我的存储库的setup.py.

与github我可以这样做:

dependency_links=['https://github.com/nathanborror/django-registration/tarball/master#egg=django-registration']
Run Code Online (Sandbox Code Playgroud)

我怎么能用bitbucket项目做同样的事情?

例如这个网址:

https://bitbucket.org/abraneo/django-registration
Run Code Online (Sandbox Code Playgroud)

谢谢.

Jam*_*ers 21

您的Github链接看起来指向一个gzipped tar文件.尝试为你的Bitbucket托管项目做同样的事情 - https://bitbucket.org/abraneo/django-registration/get/tip.tar.gz

  • 从pip运行`pip install https:// bitbucket.org/abraneo/django-registration/get/tip.tar.gz安装bitbucket项目 (9认同)

gly*_*bet 7

可以使用以下URL添加BitBucket Mercurial(hg)存储库dependency_links:

'https://bitbucket.org/zzzeek/alembic/get/tip.zip#egg=alembic-0.6.0'
Run Code Online (Sandbox Code Playgroud)

在这种情况下,它会安装Alembic软件包的开发版本(0.6),该软件包在撰写本文时尚未在PyPI中.

请注意,BitBucket支持Mercurial和git.如果repo是Mercurial,则URL必须引用tip.zip,但如果是git,则URL必须引用master.zip.