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

Skip to content

Commit e413c06

Browse files
committed
Make distutils’ upload command work with bdist_msi products (#13719).
Patch by Ralf Schmitt.
1 parent e5eec7e commit e413c06

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

Lib/distutils/command/bdist_msi.py

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

262262
if hasattr(self.distribution, 'dist_files'):
263-
tup = 'bdist_msi', self.target_version or 'any', fullname
263+
tup = 'bdist_msi', self.target_version or 'any', installer_name
264264
self.distribution.dist_files.append(tup)
265265

266266
if not self.keep_temp:

Lib/distutils/tests/test_bdist_msi.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
"""Tests for distutils.command.bdist_msi."""
2-
import unittest
32
import sys
4-
3+
import unittest
54
from test.support import run_unittest
6-
75
from distutils.tests import support
86

9-
@unittest.skipUnless(sys.platform=="win32", "These tests are only for win32")
7+
8+
@unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows')
109
class BDistMSITestCase(support.TempdirManager,
1110
support.LoggingSilencer,
1211
unittest.TestCase):
1312

1413
def test_minimal(self):
1514
# minimal test XXX need more tests
1615
from distutils.command.bdist_msi import bdist_msi
17-
pkg_pth, dist = self.create_dist()
16+
project_dir, dist = self.create_dist()
1817
cmd = bdist_msi(dist)
1918
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')])
27+
2028

2129
def test_suite():
2230
return unittest.makeSuite(BDistMSITestCase)

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ Core and Builtins
130130
Library
131131
-------
132132

133+
- Issue #13719: Make the distutils upload command aware of bdist_msi products.
134+
133135
- Issue #14195: An issue that caused weakref.WeakSet instances to incorrectly
134136
return True for a WeakSet instance 'a' in both 'a < a' and 'a > a' has been
135137
fixed.

0 commit comments

Comments
 (0)