PyPI 上轮子的平台约束有什么限制吗? [英] Any limitations on platform constraints for wheels on PyPI?

查看:72
本文介绍了PyPI 上轮子的平台约束有什么限制吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否在任何地方(PEP 或其他地方)声明了关于上传到 PyPI 的 Linux 轮子的范围应有多大的限制有?具体来说:将 linux_x86_64 轮子上传到 PyPI 而不是 manylinux1_x86_64 是否被认为是可接受的做法,当我们无法构建后者时 - 由于外部 C 库依赖于较新的 glibc?

另见PEP 513/基本原理"::><块引用>

使用 PEP 425 平台标签 [3] 的构建工具不会跟踪有关特定 Linux 发行版或已安装系统库的信息,而是为所有轮子分配过于模糊的 linux_i686 或 linux_x86_64 标签.由于这种歧义,不能期望在一台机器上编译的带有 linux 标记的构建发行版在另一台机器上正常工作,因此,PyPI 不允许为 Linux 上传轮子.

和PyPI支持":

<块引用>

PyPI 应该允许上传包含 manylinux1 平台标签的轮子.PyPI 不应尝试正式验证包含 manylinux1 平台标签的轮子是否符合本文档中描述的 manylinux1 策略.此验证任务应留给其他工具,例如单独开发的 auditwheel.

解决方案

好吧,尝试上传到 https://test.pypi.org 说:

<块引用>

HTTPError:400 客户端错误:二进制轮foo-cp35-cp35m-linux_x86_64.whl"具有不受支持的平台标记linux_x86_64".对于网址:https://test.pypi.org/legacy/

Are there any limitations declared anywhere (PEPs or elsewhere) about how broad a scope the Linux wheels uploaded to PyPI should have? Specifically: is it considered acceptable practice to upload linux_x86_64 wheels to PyPI, instead of manylinux1_x86_64, when we are unable to build the latter - due to external C libraries that depend on a newer glibc?

See also PEP 513 / "Rationale":

Build tools using PEP 425 platform tags [3] do not track information about the particular Linux distribution or installed system libraries, and instead assign all wheels the too-vague linux_i686 or linux_x86_64 tags. Because of this ambiguity, there is no expectation that linux-tagged built distributions compiled on one machine will work properly on another, and for this reason, PyPI has not permitted the uploading of wheels for Linux.

and "PyPI Support":

PyPI should permit wheels containing the manylinux1 platform tag to be uploaded. PyPI should not attempt to formally verify that wheels containing the manylinux1 platform tag adhere to the manylinux1 policy described in this document. This verification tasks should be left to other tools, like auditwheel, that are developed separately.

解决方案

Well, trying to upload to https://test.pypi.org says:

HTTPError: 400 Client Error: Binary wheel 'foo-cp35-cp35m-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'. for url: https://test.pypi.org/legacy/

这篇关于PyPI 上轮子的平台约束有什么限制吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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