Skip to content

Commit 29b3fc0

Browse files
authored
bpo-39586: Deprecate distutils bdist_msi command (GH-18415)
1 parent 5305cc9 commit 29b3fc0

File tree

7 files changed

+31
-3
lines changed

7 files changed

+31
-3
lines changed

Doc/distutils/apiref.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,6 +1855,9 @@ Subclasses of :class:`Command` must define the following methods.
18551855

18561856
.. class:: bdist_msi
18571857

1858+
.. deprecated:: 3.9
1859+
Use bdist_wheel (wheel packages) instead.
1860+
18581861
Builds a `Windows Installer`_ (.msi) binary package.
18591862

18601863
.. _Windows Installer: https://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx

Doc/distutils/builtdist.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ generated by each, are:
149149
.. note::
150150
bdist_wininst is deprecated since Python 3.8.
151151

152+
.. note::
153+
bdist_msi is deprecated since Python 3.9.
154+
152155
The following sections give details on the individual :command:`bdist_\*`
153156
commands.
154157

@@ -304,6 +307,9 @@ Creating Windows Installers
304307
.. warning::
305308
bdist_wininst is deprecated since Python 3.8.
306309

310+
.. warning::
311+
bdist_msi is deprecated since Python 3.9.
312+
307313
Executable installers are the natural format for binary distributions on
308314
Windows. They display a nice graphical user interface, display some information
309315
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).
468474

469475
.. note::
470476
bdist_wininst is deprecated since Python 3.8.
477+
478+
.. note::
479+
bdist_msi is deprecated since Python 3.9.

Doc/whatsnew/3.9.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ Build and C API Changes
398398
Deprecated
399399
==========
400400

401+
* The distutils ``bdist_msi`` command is now deprecated, use
402+
``bdist_wheel`` (wheel packages) instead.
403+
(Contributed by Hugo van Kemenade in :issue:`39586`.)
404+
401405
* Currently :func:`math.factorial` accepts :class:`float` instances with
402406
non-negative integer values (like ``5.0``). It raises a :exc:`ValueError`
403407
for non-integral and negative floats. It is now deprecated. In future

Lib/distutils/command/bdist_msi.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
Implements the bdist_msi command.
77
"""
88

9-
import sys, os
9+
import os
10+
import sys
11+
import warnings
1012
from distutils.core import Command
1113
from distutils.dir_util import remove_tree
1214
from distutils.sysconfig import get_python_version
@@ -122,6 +124,12 @@ class bdist_msi(Command):
122124
'3.5', '3.6', '3.7', '3.8', '3.9']
123125
other_version = 'X'
124126

127+
def __init__(self, *args, **kw):
128+
super().__init__(*args, **kw)
129+
warnings.warn("bdist_msi command is deprecated since Python 3.9, "
130+
"use bdist_wheel (wheel packages) instead",
131+
DeprecationWarning, 2)
132+
125133
def initialize_options(self):
126134
self.bdist_dir = None
127135
self.plat_name = None

Lib/distutils/tests/test_bdist_msi.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Tests for distutils.command.bdist_msi."""
22
import sys
33
import unittest
4-
from test.support import run_unittest
4+
from test.support import run_unittest, check_warnings
55
from distutils.tests import support
66

77

@@ -14,7 +14,8 @@ def test_minimal(self):
1414
# minimal test XXX need more tests
1515
from distutils.command.bdist_msi import bdist_msi
1616
project_dir, dist = self.create_dist()
17-
cmd = bdist_msi(dist)
17+
with check_warnings(("", DeprecationWarning)):
18+
cmd = bdist_msi(dist)
1819
cmd.ensure_finalized()
1920

2021

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ Dmitry Kazakov
843843
Brian Kearns
844844
Sebastien Keim
845845
Ryan Kelly
846+
Hugo van Kemenade
846847
Dan Kenigsberg
847848
Randall Kern
848849
Robert Kern
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The distutils ``bdist_msi`` command is deprecated in Python 3.9, use
2+
``bdist_wheel`` (wheel packages) instead.

0 commit comments

Comments
 (0)