Commit 2b5b9133 authored by Paul Ganssle's avatar Paul Ganssle

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
parent fe2c9e42
...@@ -102,14 +102,8 @@ class upload(orig.upload): ...@@ -102,14 +102,8 @@ class upload(orig.upload):
'requires': meta.get_requires(), 'requires': meta.get_requires(),
'obsoletes': meta.get_obsoletes(), 'obsoletes': meta.get_obsoletes(),
} }
comment = ''
if command == 'bdist_rpm': data['comment'] = ''
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
if self.sign: if self.sign:
data['gpg_signature'] = (os.path.basename(filename) + ".asc", data['gpg_signature'] = (os.path.basename(filename) + ".asc",
......
...@@ -203,26 +203,6 @@ class TestUploadTest: ...@@ -203,26 +203,6 @@ class TestUploadTest:
entries = patched_upload.get_uploaded_metadata() entries = patched_upload.get_uploaded_metadata()
assert entries['gpg_signature'] == 'signed-data' 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): def test_show_response_no_error(self, patched_upload):
# This test is just that show_response doesn't throw an error # This test is just that show_response doesn't throw an error
# It is not really important what the printed response looks like # It is not really important what the printed response looks like
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment