是否可以使用 None zip-safe 标志默认使用 Distribute 安装压缩鸡蛋?

发布于 2024-10-05 18:25:31 字数 576 浏览 6 评论 0原文

我们的大型 python 项目正在从使用旧的“setuptools”项目升级为使用“distribute”作为直接替代品。

我们注意到这两个应用程序之间存在一个有问题的差异:在 setuptools 中,具有未定义的 zip 安全标志的 Egg 被假定为 zip 安全,并将作为压缩文件安装(除非用户明确指定不这样做)。

与新的 Distribute 相比,所有的 Egg 都被认为不是 zip 安全的(并且会解压安装),除非它们将 zip-safe 标志明确设置为 True。

因此,以前只需将 .egg 文件复制到站点包即可安装的 Egg 现在已解压缩到站点包。理想情况下,我希望新发行版以与旧安装工具完全一致的方式安装eggs。

这听起来可能是一件无关紧要的事情,但是如果我们更改像 site-packages 文件夹的目录结构这样基本的东西,它将迫使我们的团队经历一个非常耗时的国际 UAT 阶段。如果我们能够简单地保证新安装程序生成与旧安装程序完全相同的目录结构,那就更好了。

仅供参考,我正在使用适用于 Windows XP 32 位的 Python 2.4.4 的最新发行版。

Our large python project is being upgraded from using the legacy "setuptools" project to use "distribute" as a drop-in replacement.

We've noticed one problematic difference between the two applications: In setuptools an egg which had an undefined zip-safe flag was assumed to be zip-safe and would install as a zipped file (unless the user explicitly specifies not to).

By comparison with the new Distribute all eggs are assumed to be not zip safe (and will install unzipped) unless they have the zip-safe flag set to be explictly True.

As a consequence eggs which would previously have been installed simply by copying the .egg file to the site-packages are now unzipped to site-packages. Ideally, I'd like the new distribute to install eggs in a manner which is exactly consistent with the older setuptools.

It may sound like an inconsequential thing, however if we change something as fundamental as the directory structure of the site-packages folder it will force our team to go through a phase of international UAT which will be very time-consuming. It would be far better if we could simply guarantee that the new installer produces the exact same directory structure as the old one.

FYI, I'm using the very latest distribute on Python 2.4.4 for Windows XP 32bit.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深居我梦 2024-10-12 18:25:31

如果您在 Windows 上使用 Python 2.4,则使用 Distribute 相对于 Setuptools 没有任何优势。 Distribute 仅在 Python 2.6(支持新的“主”目录布局)和 Python 3.x(setuptools 尚未移植到)上提供相对优势。

除此之外,相对于 setuptools,Distribute 并没有真正的“升级”。事实上,Distribute 仍然包含在 setuptools 中已修复的错误,或者在 setuptools 中从未存在的错误(因为它们是在 Distribute 中添加的)。

您还应该意识到,创建 Distribute 的人现在主要致力于 Distutils2,并且不打算对 Distribute 进行任何重大改进。

我意识到这可能不是您正在寻找的答案,因为显然您已经决定切换。但是,如果您纯粹基于流行的谣言进行切换,即 setuptools 未得到维护或具有 Distribute 修复的错误(实际上是相反的情况),您可能需要重新考虑。

If you're using Python 2.4 on Windows, there aren't any advantages to using Distribute over Setuptools. Distribute only offers a comparative advantage on Python 2.6 (where it supports the new "home" directory layout) and Python 3.x (which setuptools hasn't been ported to).

Apart from that, there aren't really any "upgrades" in Distribute, relative to setuptools; in fact, Distribute still contains bugs that have either been fixed in setuptools, or that never existed in setuptools (because they were added in Distribute).

You should also be aware that the people who created Distribute are now mainly working on Distutils2, and are NOT planning any significant improvements to Distribute.

I realize this might not be the answer you're looking for, since apparently you've already decided to switch. However, if you switched purely on the basis of the popular rumor that setuptools isn't maintained or has bugs that Distribute fixes (which is actually the other way around), you might want to reconsider.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文