diff options
author | Paul Ganssle <pganssle@users.noreply.github.com> | 2018-11-12 22:46:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 22:46:08 -0500 |
commit | f52b3b1c976e54df7a70db42bf59ca283412b461 (patch) | |
tree | 15b1b7355c915cb6053311773947f24b8f075de1 | |
parent | 95df56d0b8699c4d6373f608a359e3fb285024ff (diff) | |
parent | ac3cee396ff93f66afa86bc6e3aa3da3a2667514 (diff) | |
download | external_python_setuptools-f52b3b1c976e54df7a70db42bf59ca283412b461.tar.gz external_python_setuptools-f52b3b1c976e54df7a70db42bf59ca283412b461.tar.bz2 external_python_setuptools-f52b3b1c976e54df7a70db42bf59ca283412b461.zip |
Merge pull request #1590 from pganssle/fix_author
Fix issue with missing author metadata
-rw-r--r-- | changelog.d/1590.change.rst | 1 | ||||
-rw-r--r-- | setuptools/dist.py | 4 | ||||
-rw-r--r-- | setuptools/tests/test_dist.py | 16 |
3 files changed, 19 insertions, 2 deletions
diff --git a/changelog.d/1590.change.rst b/changelog.d/1590.change.rst new file mode 100644 index 00000000..6d2a9140 --- /dev/null +++ b/changelog.d/1590.change.rst @@ -0,0 +1 @@ +Fixed regression where packages without ``author`` or ``author_email`` fields generated malformed package metadata. diff --git a/setuptools/dist.py b/setuptools/dist.py index b741c648..7062ae8d 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -138,8 +138,8 @@ def write_pkg_file(self, file): write_field('Home-page', self.get_url()) if version < StrictVersion('1.2'): - write_field('Author:', self.get_contact()) - write_field('Author-email:', self.get_contact_email()) + write_field('Author', self.get_contact()) + write_field('Author-email', self.get_contact_email()) else: optional_fields = ( ('Author', 'author'), diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index a7f4452b..170d27ed 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -115,6 +115,20 @@ def __read_test_cases(): merge_dicts(base_attrs, { 'provides_extras': ['foo', 'bar'] }), marks=pytest.mark.xfail(reason="provides_extras not read")), + ('Missing author, missing author e-mail', + {'name': 'foo', 'version': '1.0.0'}), + ('Missing author', + {'name': 'foo', + 'version': '1.0.0', + 'author_email': 'snorri@sturluson.name'}), + ('Missing author e-mail', + {'name': 'foo', + 'version': '1.0.0', + 'author': 'Snorri Sturluson'}), + ('Missing author', + {'name': 'foo', + 'version': '1.0.0', + 'author': 'Snorri Sturluson'}), ] return test_cases @@ -141,6 +155,8 @@ def test_read_metadata(name, attrs): tested_attrs = [ ('name', dist_class.get_name), ('version', dist_class.get_version), + ('author', dist_class.get_contact), + ('author_email', dist_class.get_contact_email), ('metadata_version', dist_class.get_metadata_version), ('provides', dist_class.get_provides), ('description', dist_class.get_description), |