为什么人们会用鸡蛋而不是sdist?
我能想到的将 python 包作为 Egg 分发的唯一原因是,您不能在包中包含 .py 文件(并且仅包含 .pyc 文件,无论如何,这是一种保护代码的可疑方法)。除此之外,我真的想不出任何理由将包作为 Egg 而不是 sdist 上传。事实上,pip 甚至不支持鸡蛋。
使用鸡蛋而不是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.
Is there any real reason to use an egg rather than an sdist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原因之一:eggs 可以包含已编译的 C 扩展模块,这样最终用户就不需要拥有必要的构建工具以及可能的附加头文件和库来从头开始构建扩展模块。这样做的缺点是打包器可能需要提供多个 Egg 来匹配每个目标平台和 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.