From 2b5b91332a01c665cab77ad7962e87525850d7f5 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Mon, 12 Nov 2018 10:08:55 -0500 Subject: [PATCH] Remove bdist_rpm and bdist_dumb comment This comment is not used anywhere and `platform.dist()` is deprecated. See CPython PR #10414: https://github.com/python/cpython/pull/10414 and bpo-35186: https://bugs.python.org/issue35186 --- setuptools/command/upload.py | 10 ++-------- setuptools/tests/test_upload.py | 20 -------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index f57fe796be..3b8cab5e06 100644 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -102,14 +102,8 @@ def upload_file(self, command, pyversion, filename): 'requires': meta.get_requires(), 'obsoletes': meta.get_obsoletes(), } - comment = '' - if command == 'bdist_rpm': - dist, version, id = platform.dist() - if dist: - comment = 'built for %s %s' % (dist, version) - elif command == 'bdist_dumb': - comment = 'built for %s' % platform.platform(terse=1) - data['comment'] = comment + + data['comment'] = '' if self.sign: data['gpg_signature'] = (os.path.basename(filename) + ".asc", diff --git a/setuptools/tests/test_upload.py b/setuptools/tests/test_upload.py index 319ed7a220..9229bba172 100644 --- a/setuptools/tests/test_upload.py +++ b/setuptools/tests/test_upload.py @@ -203,26 +203,6 @@ def test_upload_file_gpg(self, spawn, patched_upload): entries = patched_upload.get_uploaded_metadata() assert entries['gpg_signature'] == 'signed-data' - @pytest.mark.parametrize('bdist', ['bdist_rpm', 'bdist_dumb']) - @mock.patch('setuptools.command.upload.platform') - def test_bdist_rpm_upload(self, platform, bdist, patched_upload): - # Set the upload command to include bdist_rpm - cmd = patched_upload.cmd - dist_files = cmd.distribution.dist_files - dist_files = [(bdist,) + dist_files[0][1:]] - cmd.distribution.dist_files = dist_files - - # Mock out the platform commands to make this platform-independent - platform.dist.return_value = ('redhat', '', '') - - cmd.ensure_finalized() - cmd.run() - - entries = patched_upload.get_uploaded_metadata() - - assert entries['comment'].startswith(u'built for') - assert len(entries['comment']) > len(u'built for') - def test_show_response_no_error(self, patched_upload): # This test is just that show_response doesn't throw an error # It is not really important what the printed response looks like