如何在 setup.py 中指定多个作者/电子邮件 [英] How to specify multiple author(s) / email(s) in setup.py
问题描述
我们为 Twitter 应用编写了一个小包装器,并将此信息发布到 http://pypi.python.org.但是 setup.py 只包含一个用于指定电子邮件/作者姓名的字段.我如何为以下字段指定多个贡献者/电子邮件列表,因为我们希望这个包以我们的名字列出,非常类似于它在 http://rubygems.org.
We wrote a small wrapper to a twitter app and published this information to http://pypi.python.org. But setup.py just contained a single field for specifying email / name of the author. How do I specify multiple contributors / email list, to the following fields since we would like this package to be listed under our names, much similar to how it shows up in http://rubygems.org.
author='foo',
author_email='foo.bar@gmail.com',
推荐答案
据我所知,setuptools
不支持使用字符串列表来指定多个作者.最好的办法是在一个字符串中列出作者:
As far as I know, setuptools
doesn't support using a list of strings in order to specify multiple authors. Your best bet is to list the authors in a single string:
author='Foo Bar, Spam Eggs',
author_email='foobar@baz.com, spameggs@joe.org',
我不确定 PyPI 是否验证 author_email
字段,因此您可能会遇到该字段的问题.在任何情况下,我都建议您将这些限制为单个作者,并在文档或说明中提及所有贡献者.
I'm not sure if PyPI validates the author_email
field, so you may run into trouble with that one. In any case, I would recommend you limit these to a single author and mention all contributors in the documentation or description.
这实际上已经注册为错误,但似乎没有实现对多作者的支持.这里是另一种解决方案.此处介绍了如何为有多个作者的项目提供联系电子邮件.
This has been registered as a bug, actually, but it seems like support for multiple authors was not implemented. Here is an alternative solution. Here is an idea for how to provide a contact email for a project with multiple authors.
这篇关于如何在 setup.py 中指定多个作者/电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!