Commit 1da44627 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)

The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.
parent a55f75a6
...@@ -1863,6 +1863,9 @@ Subclasses of :class:`Command` must define the following methods. ...@@ -1863,6 +1863,9 @@ Subclasses of :class:`Command` must define the following methods.
.. module:: distutils.command.bdist_wininst .. module:: distutils.command.bdist_wininst
:synopsis: Build a Windows installer :synopsis: Build a Windows installer
.. deprecated:: 3.8
Use bdist_wheel (wheel packages) instead.
.. % todo .. % todo
......
...@@ -146,6 +146,9 @@ generated by each, are: ...@@ -146,6 +146,9 @@ generated by each, are:
| :command:`bdist_msi` | msi | | :command:`bdist_msi` | msi |
+--------------------------+-------------------------------------+ +--------------------------+-------------------------------------+
.. note::
bdist_wininst is deprecated since Python 3.8.
The following sections give details on the individual :command:`bdist_\*` The following sections give details on the individual :command:`bdist_\*`
commands. commands.
...@@ -298,6 +301,9 @@ file winds up deep in the "build tree," in a temporary directory created by ...@@ -298,6 +301,9 @@ file winds up deep in the "build tree," in a temporary directory created by
Creating Windows Installers Creating Windows Installers
=========================== ===========================
.. warning::
bdist_wininst is deprecated since Python 3.8.
Executable installers are the natural format for binary distributions on Executable installers are the natural format for binary distributions on
Windows. They display a nice graphical user interface, display some information Windows. They display a nice graphical user interface, display some information
about the module distribution to be installed taken from the metadata in the 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 ...@@ -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 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 valid values are 'auto' (meaning prompt for UAC elevation if Python was
installed for all users) and 'force' (meaning always prompt for elevation). installed for all users) and 'force' (meaning always prompt for elevation).
.. note::
bdist_wininst is deprecated since Python 3.8.
...@@ -1068,6 +1068,10 @@ Build and C API Changes ...@@ -1068,6 +1068,10 @@ Build and C API Changes
Deprecated 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 * Deprecated methods ``getchildren()`` and ``getiterator()`` in
the :mod:`~xml.etree.ElementTree` module emit now a the :mod:`~xml.etree.ElementTree` module emit now a
:exc:`DeprecationWarning` instead of :exc:`PendingDeprecationWarning`. :exc:`DeprecationWarning` instead of :exc:`PendingDeprecationWarning`.
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
Implements the Distutils 'bdist_wininst' command: create a windows installer Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.""" exe-program."""
import sys, os import os
import sys
import warnings
from distutils.core import Command from distutils.core import Command
from distutils.util import get_platform from distutils.util import get_platform
from distutils.dir_util import create_tree, remove_tree from distutils.dir_util import create_tree, remove_tree
...@@ -58,6 +60,12 @@ class bdist_wininst(Command): ...@@ -58,6 +60,12 @@ class bdist_wininst(Command):
# bpo-10945: bdist_wininst requires mbcs encoding only available on Windows # bpo-10945: bdist_wininst requires mbcs encoding only available on Windows
_unsupported = (sys.platform != "win32") _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): def initialize_options(self):
self.bdist_dir = None self.bdist_dir = None
self.plat_name = None self.plat_name = None
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import sys import sys
import platform import platform
import unittest 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.command.bdist_wininst import bdist_wininst
from distutils.tests import support from distutils.tests import support
...@@ -21,7 +21,8 @@ class BuildWinInstTestCase(support.TempdirManager, ...@@ -21,7 +21,8 @@ class BuildWinInstTestCase(support.TempdirManager,
# this test makes sure it works now for every platform # this test makes sure it works now for every platform
# let's create a command # let's create a command
pkg_pth, dist = self.create_dist() pkg_pth, dist = self.create_dist()
cmd = bdist_wininst(dist) with check_warnings(("", DeprecationWarning)):
cmd = bdist_wininst(dist)
cmd.ensure_finalized() cmd.ensure_finalized()
# let's run the code that finds the right wininst*.exe file # let's run the code that finds the right wininst*.exe file
......
The distutils ``bdist_wininst`` command is deprecated in Python 3.8, use
``bdist_wheel`` (wheel packages) instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment