summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2020-02-10 15:26:40 +0200
committerGitHub <noreply@github.com>2020-02-10 14:26:40 +0100
commit8e5f7c22088ad8ee03096d1e591449bed2f14e44 (patch)
treeea8aee91e193e951b75d41f5c2bbb8e8bf0e0473
parentd6bd6b1ea7efff2df20ca970de45fb0c2fe701e7 (diff)
downloadpython-setuptools-git-8e5f7c22088ad8ee03096d1e591449bed2f14e44.tar.gz
bpo-39586: Deprecate distutils bdist_msi command (GH-18415)
-rw-r--r--command/bdist_msi.py10
-rw-r--r--tests/test_bdist_msi.py5
2 files changed, 12 insertions, 3 deletions
diff --git a/command/bdist_msi.py b/command/bdist_msi.py
index f335a348..0863a188 100644
--- a/command/bdist_msi.py
+++ b/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/tests/test_bdist_msi.py b/tests/test_bdist_msi.py
index 15d8bdff..418e60ec 100644
--- a/tests/test_bdist_msi.py
+++ b/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 @@ class BDistMSITestCase(support.TempdirManager,
# 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()