我目前使用setuptools
构建我的 Python 包,我已经在我的文件中以这种方式声明了两位作者pyproject.toml
file:
authors = [
{name = "X Y", email = "[email protected] /cdn-cgi/l/email-protection"},
{name = "Z H", email = "[email protected] /cdn-cgi/l/email-protection"},
]
一切正常,我可以在 PyPI 上发布它,但只发布第一作者。我怎样才能显示两位作者。
我尝试使用以下语法
authors = ["X Y <[email protected] /cdn-cgi/l/email-protection>, Z H <[email protected] /cdn-cgi/l/email-protection>"]
但我有以下错误
ValueError: invalid pyproject.toml config: `project.authors[{data__authors_x}]`.
configuration error: `project.authors[{data__authors_x}]` must be object
请注意,我指定:
[build-system]
requires = ["setuptools","numpy","scipy","wheel"]
build-backend = "setuptools.build_meta"
您的原始符号是正确的:
authors = [
{name = "X Y", email = "[email protected] /cdn-cgi/l/email-protection"},
{name = "Z H", email = "[email protected] /cdn-cgi/l/email-protection"},
]
但有些问题是您无法控制的。
一方面,尚不完全清楚这应如何转化为核心元数据符号,这是分布工件(轮)内部使用的符号,然后通过以下方式提取并显示PyPI.
另一方面,构建后端(setuptools
包括)没有明确说明它们如何从pyproject.toml
符号核心元数据符号,他们倾向于默默地选择列表中的第一项,而忽略后面的项目。
参考:
- https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#authors-maintainers https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#authors-maintainers
- https://packaging.python.org/en/latest/specifications/core-metadata/#author https://packaging.python.org/en/latest/specifications/core-metadata/#author
- https://packaging.python.org/en/latest/specifications/core-metadata/#author-email https://packaging.python.org/en/latest/specifications/core-metadata/#author-email
- https://discuss.python.org/t/the-author-maintainer-distinction-problem-and-pep-621/4562 https://discuss.python.org/t/the-author-maintainer-distinction-problem-and-pep-621/4562
- https://discuss.python.org/t/pep-621-round-3/5472/72 https://discuss.python.org/t/pep-621-round-3/5472/72
- https://discuss.python.org/t/pep-621-round-3/5472/86 https://discuss.python.org/t/pep-621-round-3/5472/86
- https://discuss.python.org/t/pep-621-round-3/5472/91 https://discuss.python.org/t/pep-621-round-3/5472/91
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)