.. module:: distutils.command.bdist_wininst
:synopsis: Build a Windows installer
+.. deprecated:: 3.8
+ Use bdist_wheel (wheel packages) instead.
+
.. % todo
| :command:`bdist_msi` | msi |
+--------------------------+-------------------------------------+
+.. note::
+ bdist_wininst is deprecated since Python 3.8.
+
The following sections give details on the individual :command:`bdist_\*`
commands.
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
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.
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`.
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
# 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
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
# 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
--- /dev/null
+The distutils ``bdist_wininst`` command is deprecated in Python 3.8, use
+``bdist_wheel`` (wheel packages) instead.