如何在不破坏pip冻结的情况下链接到distutils中的分叉包? [英] How to link to forked package in distutils, without breaking pip freeze?

查看:89
本文介绍了如何在不破坏pip冻结的情况下链接到distutils中的分叉包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前言 官方python软件包python-openid(通过pypi.org分发)不适用于Google Apps.有人对此进行了修复,并将修补的源上传到github.现在,我想创建一个应该链接到该分叉包的包.

Preface The official python package python-openid (as distributed through pypi.org) does not work with Google Apps. Somebody wrote a fix to this and uploaded the patched source to github. Now I want to create a package which should link to this forked package.

现在,在安装此软件包时,一切都很好.分叉的软件包已安装,一切都很好.但是,在执行pip freeze时,没有提及包的来源.由于应使用分叉的程序包,包括正式程序包会中断部署.如何链接到我自己的程序包中的分叉程序包,并在pip freeze中列出分叉的程序包?

Now when installing this package, everything is well. The forked package is installed and everything is fine. However, when doing a pip freeze, there is no mentioning of where the package came from. As the forked package should be used, including the official package breaks deployments. How can I link to a forked package in my own package and also list the forked package in pip freeze?

更新

好,所以我创建了标签2.2.5-bouke0,创建了一个发行版并将其上传到 github .我的引用包的setup.py现在看起来像这样:

Ok, so I created the tag 2.2.5-bouke0, created a distribution and uploaded it to github. My setup.py of the referencing package now looks like this:

dependency_links=[
    'http://github.com/Bouke/python-openid/downloads',
],
install_requires=[
    'python-openid == 2.2.5-bouke0',
],

在构建和安装此软件包时,一切都很好.引用的包是从github下载并正确安装的.但是,pip freeze不会显示软件包的来源:

When building and installing this package everything is fine. The referenced package is downloaded from github and installed correctly. However, pip freeze does not show where the package came from:

django-federated-login==0.1.3
python-openid==2.2.5-bouke0

由于在pypi上找不到版本2.2.5-bouke0,因此此类requirements.txt的部署将失败.如何指示pip freeze引用从何处获取软件包的替代来源?

As the version 2.2.5-bouke0 cannot be found on pypi, the deployment of such a requirements.txt will fail. How can I instruct pip freeze to reference the alternative source from where to get the package?

推荐答案

在存储库中添加标签2.2.5.

-f https://github.com/adieu/python-openid/downloads放入requirements.txt文件.

可以肯定的是,将版本号更改为类似2.2.5-bouke1的名称.阅读semver.org了解详细信息.

To be sure, change version number to something like 2.2.5-bouke1. Read semver.org for details.

这篇关于如何在不破坏pip冻结的情况下链接到distutils中的分叉包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆