Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8e280d

Browse files
committed
Make packaging’ upload command work with bdist_msi products (#13719)
1 parent d167123 commit b8e280d

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

Lib/packaging/command/bdist_msi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def run(self):
261261
self.db.Commit()
262262

263263
if hasattr(self.distribution, 'dist_files'):
264-
tup = 'bdist_msi', self.target_version or 'any', fullname
264+
tup = 'bdist_msi', self.target_version or 'any', installer_name
265265
self.distribution.dist_files.append(tup)
266266

267267
if not self.keep_temp:

Lib/packaging/tests/test_command_bdist_msi.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
"""Tests for distutils.command.bdist_msi."""
2+
import os
23
import sys
34

45
from packaging.tests import unittest, support
56

67

8+
@unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows')
79
class BDistMSITestCase(support.TempdirManager,
810
support.LoggingCatcher,
911
unittest.TestCase):
1012

11-
@unittest.skipUnless(sys.platform == "win32", "runs only on win32")
1213
def test_minimal(self):
1314
# minimal test XXX need more tests
1415
from packaging.command.bdist_msi import bdist_msi
15-
pkg_pth, dist = self.create_dist()
16+
project_dir, dist = self.create_dist()
1617
cmd = bdist_msi(dist)
1718
cmd.ensure_finalized()
19+
cmd.run()
20+
21+
bdists = os.listdir(os.path.join(project_dir, 'dist'))
22+
self.assertEqual(bdists, ['foo-0.1.msi'])
23+
24+
# bug #13719: upload ignores bdist_msi files
25+
self.assertEqual(dist.dist_files,
26+
[('bdist_msi', 'any', 'dist/foo-0.1.msi')])
1827

1928

2029
def test_suite():

Misc/NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Core and Builtins
1313
Library
1414
-------
1515

16-
- Issue #13719: Make the distutils upload command aware of bdist_msi products.
16+
- Issue #13719: Make the distutils and packaging upload commands aware of
17+
bdist_msi products.
1718

1819
- Issue #14007: Accept incomplete TreeBuilder objects (missing start, end,
1920
data or close method) for the Python implementation as well.

0 commit comments

Comments
 (0)