]> granicus.if.org Git - python/commitdiff
Make packaging’ upload command work with bdist_msi products (#13719)
authorÉric Araujo <merwok@netwok.org>
Mon, 5 Mar 2012 16:04:07 +0000 (17:04 +0100)
committerÉric Araujo <merwok@netwok.org>
Mon, 5 Mar 2012 16:04:07 +0000 (17:04 +0100)
Lib/packaging/command/bdist_msi.py
Lib/packaging/tests/test_command_bdist_msi.py
Misc/NEWS

index 995eec57e5ae597e4a4cd9811ca5b3dadb890f0b..ad1edef24b51769bec2c6cc201fd39c2bb3776e4 100644 (file)
@@ -261,7 +261,7 @@ class bdist_msi(Command):
         self.db.Commit()
 
         if hasattr(self.distribution, 'dist_files'):
-            tup = 'bdist_msi', self.target_version or 'any', fullname
+            tup = 'bdist_msi', self.target_version or 'any', installer_name
             self.distribution.dist_files.append(tup)
 
         if not self.keep_temp:
index fded962dbf6831d28e5c5a491f1deca773c6571a..25973efeeeb5e3b063e531966b2cb9790afa736b 100644 (file)
@@ -1,20 +1,29 @@
 """Tests for distutils.command.bdist_msi."""
+import os
 import sys
 
 from packaging.tests import unittest, support
 
 
+@unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows')
 class BDistMSITestCase(support.TempdirManager,
                        support.LoggingCatcher,
                        unittest.TestCase):
 
-    @unittest.skipUnless(sys.platform == "win32", "runs only on win32")
     def test_minimal(self):
         # minimal test XXX need more tests
         from packaging.command.bdist_msi import bdist_msi
-        pkg_pth, dist = self.create_dist()
+        project_dir, dist = self.create_dist()
         cmd = bdist_msi(dist)
         cmd.ensure_finalized()
+        cmd.run()
+
+        bdists = os.listdir(os.path.join(project_dir, 'dist'))
+        self.assertEqual(bdists, ['foo-0.1.msi'])
+
+        # bug #13719: upload ignores bdist_msi files
+        self.assertEqual(dist.dist_files,
+                         [('bdist_msi', 'any', 'dist/foo-0.1.msi')])
 
 
 def test_suite():
index e2455c80e2ca99326f1ae814d595a7b58fd5b9cb..52fd990ba1c55b88212af2fe13fc173007eaf059 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,7 +13,8 @@ Core and Builtins
 Library
 -------
 
-- Issue #13719: Make the distutils upload command aware of bdist_msi products.
+- Issue #13719: Make the distutils and packaging upload commands aware of
+  bdist_msi products.
 
 - Issue #14007: Accept incomplete TreeBuilder objects (missing start, end,
   data or close method) for the Python implementation as well.