为什么要在sdist上使用一个鸡蛋? [英] Why would one use an egg over an sdist?

查看:123
本文介绍了为什么要在sdist上使用一个鸡蛋?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于我可以想到将python软件包作为鸡蛋分发的唯一原因是,您不能在软件包中包含.py文件(而仅包含.pyc文件,这是保护代码的一种可疑方式)反正).除此之外,我真的想不出任何理由将软件包作为蛋而不是sdist上传.实际上,点子甚至都不支持鸡蛋.

About the only reason I can think of to distribute a python package as an egg is so that you can not include the .py files with your package (and only include .pyc files, which is a dubious way to protect your code anyway). Aside from that, I can't really think of any reason to upload a package as an egg rather than an sdist. In fact, pip doesn't even support eggs.

有什么真正的理由使用鸡蛋而不是sdist吗?

Is there any real reason to use an egg rather than an sdist?

推荐答案

一个原因:egg可以包含已编译的C扩展模块,因此最终用户不需要具有必要的构建工具以及可能的其他头文件和库来构建.从头开始扩展模块.这样做的缺点是,打包程序可能需要提供多个鸡蛋来匹配每个目标平台和Python配置.如果有许多受支持的配置,这可能会是一项艰巨的任务,但对于更同质的环境可能是有效的.

One reason: eggs can include compiled C extension modules so that the end user does not need to have the necessary build tools and possible additional headers and libraries to build the extension module from scratch. The drawback to that is that the packager may need to supply multiple eggs to match each targeted platform and Python configuration. If there are many supported configurations, that can prove to be a daunting task but it can be effective for more homogenous environments.

这篇关于为什么要在sdist上使用一个鸡蛋?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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