且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

zip_safe 仅与蛋格式相关吗?

更新时间:2023-02-26 19:10:20

我相信 部分是否可以直接从轮文件中导入 Python 代码?"来自 PEP 427 可以回答您的问题.简而言之,在技术上可以保持压缩包,但将它们解压缩安装有一些优势:更容易访问元数据并防止某些极端情况(无法在 zip 文件中执行二进制文件).所以这就解释了为什么 zip_safe 不再与一般情况相关,特别是对于 wheels.

I believe the section "Is it possible to import Python code directly from a wheel file?" from PEP 427 could answer your question. In short, it is technically possible to leave the packages zipped, but there are advantages in installing them unzipped: easier access to metadata and prevention against some corner cases (can't execute binaries in a zip file). So that would explain why the zip_safe is not relevant anymore in general and for wheels in particular.

现在,我相信 eggs 仅用于一些罕见的特定情况.其中之一是 setuptools 开发模式pip 可编辑模式,以利用 鸡蛋链接 功能.

Nowadays, I believe eggs are only used in some rare specific cases. One of them is the setuptools develop mode or pip editable mode, in order to take advantage of the egg link feature.