]> granicus.if.org Git - python/commitdiff
bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 5 Jul 2019 09:03:23 +0000 (02:03 -0700)
committerGitHub <noreply@github.com>
Fri, 5 Jul 2019 09:03:23 +0000 (02:03 -0700)
The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.
(cherry picked from commit 1da4462765b084dfa8d869b6cb5855e8f6014a11)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Doc/distutils/apiref.rst
Doc/distutils/builtdist.rst
Doc/whatsnew/3.8.rst
Lib/distutils/command/bdist_wininst.py
Lib/distutils/tests/test_bdist_wininst.py
Misc/NEWS.d/next/Library/2019-07-02-13-08-30.bpo-37481.hd5k09.rst [new file with mode: 0644]

index 2601d30f63eb4c3d4df96a5f8f3c199f85d29078..937f19f57be95a988aaa1731193b3ca1cea5dcfd 100644 (file)
@@ -1863,6 +1863,9 @@ Subclasses of :class:`Command` must define the following methods.
 .. module:: distutils.command.bdist_wininst
    :synopsis: Build a Windows installer
 
+.. deprecated:: 3.8
+   Use bdist_wheel (wheel packages) instead.
+
 
 .. % todo
 
index 8c65d9d591188bc38e3c1f0d3a4d666a2b92dbe0..b814f2e9508c9cab049f5bb11059e83a8c63a032 100644 (file)
@@ -146,6 +146,9 @@ generated by each, are:
 | :command:`bdist_msi`     | msi                                 |
 +--------------------------+-------------------------------------+
 
+.. note::
+   bdist_wininst is deprecated since Python 3.8.
+
 The following sections give details on the individual :command:`bdist_\*`
 commands.
 
@@ -298,6 +301,9 @@ file winds up deep in the "build tree," in a temporary directory created by
 Creating Windows Installers
 ===========================
 
+.. warning::
+   bdist_wininst is deprecated since Python 3.8.
+
 Executable installers are the natural format for binary distributions on
 Windows.  They display a nice graphical user interface, display some information
 about the module distribution to be installed taken from the metadata in the
@@ -459,3 +465,6 @@ Starting with Python 2.6, bdist_wininst supports a :option:`!--user-access-contr
 option.  The default is 'none' (meaning no UAC handling is done), and other
 valid values are 'auto' (meaning prompt for UAC elevation if Python was
 installed for all users) and 'force' (meaning always prompt for elevation).
+
+.. note::
+   bdist_wininst is deprecated since Python 3.8.
index 1f5694caf9a46e85184fd5308675c7999bf5de60..38413a38bb8d6ddf6a0c4f8e970bead44b79920b 100644 (file)
@@ -1065,6 +1065,10 @@ Build and C API Changes
 Deprecated
 ==========
 
+* The distutils ``bdist_wininst`` command is now deprecated, use
+  ``bdist_wheel`` (wheel packages) instead.
+  (Contributed by Victor Stinner in :issue:`37481`.)
+
 * Deprecated methods ``getchildren()`` and ``getiterator()`` in
   the :mod:`~xml.etree.ElementTree` module emit now a
   :exc:`DeprecationWarning` instead of :exc:`PendingDeprecationWarning`.
index acaa184b5f7113792b8858295793ae6b6caf7031..b5ed6f041e19a04d69307d7ddf3ff9f7361845e1 100644 (file)
@@ -3,7 +3,9 @@
 Implements the Distutils 'bdist_wininst' command: create a windows installer
 exe-program."""
 
-import sys, os
+import os
+import sys
+import warnings
 from distutils.core import Command
 from distutils.util import get_platform
 from distutils.dir_util import create_tree, remove_tree
@@ -58,6 +60,12 @@ class bdist_wininst(Command):
     # bpo-10945: bdist_wininst requires mbcs encoding only available on Windows
     _unsupported = (sys.platform != "win32")
 
+    def __init__(self, *args, **kw):
+        super().__init__(*args, **kw)
+        warnings.warn("bdist_wininst command is deprecated since Python 3.8, "
+                      "use bdist_wheel (wheel packages) instead",
+                      DeprecationWarning, 2)
+
     def initialize_options(self):
         self.bdist_dir = None
         self.plat_name = None
index 163f1cc97bf9a8c75e38c114e8317c233e9139f0..5c3d025d3321d21de8ef3720027aa6203c23759d 100644 (file)
@@ -2,7 +2,7 @@
 import sys
 import platform
 import unittest
-from test.support import run_unittest
+from test.support import run_unittest, check_warnings
 
 from distutils.command.bdist_wininst import bdist_wininst
 from distutils.tests import support
@@ -21,7 +21,8 @@ class BuildWinInstTestCase(support.TempdirManager,
         # this test makes sure it works now for every platform
         # let's create a command
         pkg_pth, dist = self.create_dist()
-        cmd = bdist_wininst(dist)
+        with check_warnings(("", DeprecationWarning)):
+            cmd = bdist_wininst(dist)
         cmd.ensure_finalized()
 
         # let's run the code that finds the right wininst*.exe file
diff --git a/Misc/NEWS.d/next/Library/2019-07-02-13-08-30.bpo-37481.hd5k09.rst b/Misc/NEWS.d/next/Library/2019-07-02-13-08-30.bpo-37481.hd5k09.rst
new file mode 100644 (file)
index 0000000..a3faecd
--- /dev/null
@@ -0,0 +1,2 @@
+The distutils ``bdist_wininst`` command is deprecated in Python 3.8, use
+``bdist_wheel`` (wheel packages) instead.