bpo-39586: Deprecate distutils bdist_msi command (GH-18415)
https://github.com/python/cpython/commit/29b3fc0a18f105de666fdd586b537f34e34... commit: 29b3fc0a18f105de666fdd586b537f34e349766d branch: master author: Hugo van Kemenade <hugovk@users.noreply.github.com> committer: GitHub <noreply@github.com> date: 2020-02-10T14:26:40+01:00 summary: bpo-39586: Deprecate distutils bdist_msi command (GH-18415) files: A Misc/NEWS.d/next/Library/2020-02-08-13-37-00.bpo-39586.nfTPxX.rst M Doc/distutils/apiref.rst M Doc/distutils/builtdist.rst M Doc/whatsnew/3.9.rst M Lib/distutils/command/bdist_msi.py M Lib/distutils/tests/test_bdist_msi.py M Misc/ACKS diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index 12e0c0b2c9757..b14197c2f94db 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -1855,6 +1855,9 @@ Subclasses of :class:`Command` must define the following methods. .. class:: bdist_msi +.. deprecated:: 3.9 + Use bdist_wheel (wheel packages) instead. + Builds a `Windows Installer`_ (.msi) binary package. .. _Windows Installer: https://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst index b814f2e9508c9..e032c03e229a5 100644 --- a/Doc/distutils/builtdist.rst +++ b/Doc/distutils/builtdist.rst @@ -149,6 +149,9 @@ generated by each, are: .. note:: bdist_wininst is deprecated since Python 3.8. +.. note:: + bdist_msi is deprecated since Python 3.9. + The following sections give details on the individual :command:`bdist_\*` commands. @@ -304,6 +307,9 @@ Creating Windows Installers .. warning:: bdist_wininst is deprecated since Python 3.8. +.. warning:: + bdist_msi is deprecated since Python 3.9. + 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 @@ -468,3 +474,6 @@ installed for all users) and 'force' (meaning always prompt for elevation). .. note:: bdist_wininst is deprecated since Python 3.8. + +.. note:: + bdist_msi is deprecated since Python 3.9. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 4991e56759b1c..4f4c7f2808d01 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -398,6 +398,10 @@ Build and C API Changes Deprecated ========== +* The distutils ``bdist_msi`` command is now deprecated, use + ``bdist_wheel`` (wheel packages) instead. + (Contributed by Hugo van Kemenade in :issue:`39586`.) + * Currently :func:`math.factorial` accepts :class:`float` instances with non-negative integer values (like ``5.0``). It raises a :exc:`ValueError` for non-integral and negative floats. It is now deprecated. In future diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index f335a34898620..0863a1883e720 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -6,7 +6,9 @@ Implements the bdist_msi command. """ -import sys, os +import os +import sys +import warnings from distutils.core import Command from distutils.dir_util import remove_tree from distutils.sysconfig import get_python_version @@ -122,6 +124,12 @@ class bdist_msi(Command): '3.5', '3.6', '3.7', '3.8', '3.9'] other_version = 'X' + def __init__(self, *args, **kw): + super().__init__(*args, **kw) + warnings.warn("bdist_msi command is deprecated since Python 3.9, " + "use bdist_wheel (wheel packages) instead", + DeprecationWarning, 2) + def initialize_options(self): self.bdist_dir = None self.plat_name = None diff --git a/Lib/distutils/tests/test_bdist_msi.py b/Lib/distutils/tests/test_bdist_msi.py index 15d8bdff2b4f5..418e60ec72977 100644 --- a/Lib/distutils/tests/test_bdist_msi.py +++ b/Lib/distutils/tests/test_bdist_msi.py @@ -1,7 +1,7 @@ """Tests for distutils.command.bdist_msi.""" import sys import unittest -from test.support import run_unittest +from test.support import run_unittest, check_warnings from distutils.tests import support @@ -14,7 +14,8 @@ def test_minimal(self): # minimal test XXX need more tests from distutils.command.bdist_msi import bdist_msi project_dir, dist = self.create_dist() - cmd = bdist_msi(dist) + with check_warnings(("", DeprecationWarning)): + cmd = bdist_msi(dist) cmd.ensure_finalized() diff --git a/Misc/ACKS b/Misc/ACKS index f3e368078124d..5a779833e68be 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -843,6 +843,7 @@ Dmitry Kazakov Brian Kearns Sebastien Keim Ryan Kelly +Hugo van Kemenade Dan Kenigsberg Randall Kern Robert Kern diff --git a/Misc/NEWS.d/next/Library/2020-02-08-13-37-00.bpo-39586.nfTPxX.rst b/Misc/NEWS.d/next/Library/2020-02-08-13-37-00.bpo-39586.nfTPxX.rst new file mode 100644 index 0000000000000..5189f131afd98 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-02-08-13-37-00.bpo-39586.nfTPxX.rst @@ -0,0 +1,2 @@ +The distutils ``bdist_msi`` command is deprecated in Python 3.9, use +``bdist_wheel`` (wheel packages) instead. \ No newline at end of file
participants (1)
-
Hugo van Kemenade