zip_safe 仅与蛋格式相关吗? [英] Is zip_safe only relevant for the egg format?

查看:55
本文介绍了zip_safe 仅与蛋格式相关吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我正确阅读了这个,那么egg格式就是一种不应该再使用了.相反,应该使用轮子格式.其他人似乎也有同样的看法.

If I read this correctly, then the egg format is something one should not use anymore. Instead, one should use the wheels format. Others seem to read this the same way.

基于这个假设:zip_safe 是否与 Egg 之外的任何其他分发格式相关?

With this assumption: Is zip_safe relevant for any other distribution format than egg?

根据这个:

一个布尔值(True 或 False)标志,用于指定项目是否可以从 zip 文件安全安装和运行.如果未提供此参数,则 bdist_egg 命令必须在每次构建 Egg 时分析项目的所有内容以查找可能存在的问题.

A boolean (True or False) flag specifying whether the project can be safely installed and run from a zip file. If this argument is not supplied, the bdist_egg command will have to analyze all of your project’s contents for possible problems each time it builds an egg.

Setuptools 没有提到轮子.所以我想它与车轮无关.所以如果我不造鸡蛋,我就不需要这个?

Setuptools does not mention wheels. So I guess it is not relevant for wheels. So if I don't build eggs, I don't need this?

但是,如果我使用 pip install -e . 安装包,它似乎创建了一个 egg 文件(好吧,一个 [package name].egg-infocode> )...所以即使使用 Python 3.8,egg 可能还没有过时?

But then, if I install packages with pip install -e ., it seems as if it creates an egg file (well, an [package name].egg-info )... so maybe egg isn't outdated, even with Python 3.8?

推荐答案

我相信 部分是否可以直接从轮文件中导入 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.

这篇关于zip_safe 仅与蛋格式相关吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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