pyproject.toml 无法使用 setuptools python -m 构建格式找到项目名称
在 pyproject.toml 中向 Python 包提供名称的正确格式是什么?这是 pyproject.toml 文件:
[project]
name = "foobar"
version = "0.0.1"
[build-system]
requires = ["setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
使用 python -m build 调用的构建会导致以下错误。
running check
warning: check: missing required meta-data: name, url
warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) should be supplied
基于这个reddit帖子问题我也遇到了同样的问题。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更新
在提出问题时,setuptools不支持在
pyproject.toml 文件(PEP 621)。所以无法回答这个问题。
现在,自版本 61.0.0 起,setuptools 支持 PEP 621:
原始答案
看来您正在尝试编写PEP 621 样式
pyproject.toml 与 setuptools 构建后端。
但是,截至目前,setuptools 尚不支持 PEP 621。这项工作正在进行中:
直到 PEP 621 支持到达 setuptools,可以:
setup.cfg
pdm
flit
trampolim
enscons
乳清
Update
At the time the question was asked, setuptools did not have support for writing its configuration in a
pyproject.toml
file (PEP 621). So it was not possible to answer the question.Now and since its version 61.0.0, setuptools has support for PEP 621:
Original answer
It seems that you are trying to write a PEP 621-style
pyproject.toml
with the setuptools build back-end.But, as of now, setuptools does not have support for PEP 621 yet. The work is ongoing:
Until PEP 621 support arrives in setuptools, one can:
setup.cfg
pdm
flit
trampolim
enscons
whey
如果您使用的是 Ubuntu,则根据此错误报告
也就是说,执行 eg:
而不是:
否则,即使您已升级
setuptools (59.x) pip 中的 >setuptools
If you are using Ubuntu, then according to this bug report
That is, do e.g.:
instead of:
Otherwise, the system may pick up the older version of
setuptools
(59.x) installed by apt even if you have upgradedsetuptools
in pip.