diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-05-09 20:16:37 +0200 |
---|---|---|
committer | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-05-22 13:17:36 +0200 |
commit | 34c31ebe437edf9d6d4ee5010461668156793569 (patch) | |
tree | 82b92690247d4f9021d26df80ace73bc177feb0f | |
parent | 273bc17bbe8d58d1e87523120da965dbfdabf53b (diff) | |
download | python-setuptools-git-34c31ebe437edf9d6d4ee5010461668156793569.tar.gz |
Changes after rebase
-rw-r--r-- | changelog.d/2628.change.rst | 3 | ||||
-rw-r--r-- | setuptools/dist.py | 7 | ||||
-rw-r--r-- | setuptools/tests/test_dist.py | 4 | ||||
-rw-r--r-- | setuptools/tests/test_egg_info.py | 4 |
4 files changed, 6 insertions, 12 deletions
diff --git a/changelog.d/2628.change.rst b/changelog.d/2628.change.rst index a7af513b..53619f89 100644 --- a/changelog.d/2628.change.rst +++ b/changelog.d/2628.change.rst @@ -1,2 +1 @@ -Write long description in message payload of PKG-INFO file. -Changed in metadata version 2.1 - by :user:`cdce8p` +Write long description in message payload of PKG-INFO file. - by :user:`cdce8p` diff --git a/setuptools/dist.py b/setuptools/dist.py index 961b3cbd..bf3b9461 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -185,10 +185,6 @@ def write_pkg_file(self, file): # noqa: C901 # is too complex (14) # FIXME for project_url in self.project_urls.items(): write_field('Project-URL', '%s, %s' % project_url) - if version < StrictVersion('2.1'): - long_desc = rfc822_escape(self.get_long_description()) - write_field('Description', long_desc) - keywords = ','.join(self.get_keywords()) if keywords: write_field('Keywords', keywords) @@ -217,8 +213,7 @@ def write_pkg_file(self, file): # noqa: C901 # is too complex (14) # FIXME for extra in self.provides_extras: write_field('Provides-Extra', extra) - if version >= StrictVersion('2.1'): - file.write("\n%s\n\n" % self.get_long_description()) + file.write("\n%s\n\n" % self.get_long_description()) sequence = tuple, list diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index 6378caef..c4279f0b 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -251,8 +251,8 @@ def test_maintainer_author(name, attrs, tmpdir): with io.open(str(fn.join('PKG-INFO')), 'r', encoding='utf-8') as f: raw_pkg_lines = f.readlines() - # Drop blank lines - pkg_lines = list(filter(None, raw_pkg_lines)) + # Drop blank lines and strip lines from default description + pkg_lines = list(filter(None, raw_pkg_lines[:-2])) pkg_lines_set = set(pkg_lines) diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 22e970a4..d7657a47 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -893,8 +893,8 @@ class TestEggInfo: with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file: pkg_info_lines = pkginfo_file.read().split('\n') assert 'Metadata-Version: 2.1' in pkg_info_lines - assert '' == pkg_info_lines[-1] - long_desc_lines = pkg_info_lines[8:] + assert '' == pkg_info_lines[-1] # last line should be empty + long_desc_lines = pkg_info_lines[pkg_info_lines.index(''):] assert 'This is a long description' in long_desc_lines assert 'over multiple lines' in long_desc_lines |