在 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
基于 this reddit post question .我有同样的问题。
最佳答案
更新
在提出问题时,setuptools 不支持将其配置写入 pyproject.toml
文件 ( PEP 621 )。所以无法回答这个问题。
现在和自版本 61.0.0 以来,setuptools 支持 PEP 621:
原始答案
看来您正在尝试编写 PEP 621 -style pyproject.toml
与 setuptools 构建后端。
但是,截至目前,setuptools 尚不支持 PEP 621。工作正在进行中:
- https://discuss.python.org/t/help-testing-experimental-features-in-setuptools/13821
- https://github.com/pypa/setuptools/tree/experimental/support-pyproject
- https://github.com/pypa/setuptools/search?q=621&type=issues
在 PEP 621 支持到达setuptools 之前,您可以:
关于python-3.x - pyproject.toml 找不到带有 setuptools python -m 构建格式的项目名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71517365/