Skip to content

Commit 92ca9ea

Browse files
authored
Merge pull request #2040 from hugovk/deprecate-bdist_wininst
Deprecate bdist_wininst
2 parents 53c284b + 8487f1a commit 92ca9ea

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

changelog.d/2040.change.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecated the ``bdist_wininst`` command. Binary packages should be built as wheels instead.

setuptools/command/bdist_wininst.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import distutils.command.bdist_wininst as orig
2+
import warnings
3+
4+
from setuptools import SetuptoolsDeprecationWarning
25

36

47
class bdist_wininst(orig.bdist_wininst):
@@ -14,6 +17,12 @@ def reinitialize_command(self, command, reinit_subcommands=0):
1417
return cmd
1518

1619
def run(self):
20+
warnings.warn(
21+
"bdist_wininst is deprecated and will be removed in a future "
22+
"version. Use bdist_wheel (wheel packages) instead.",
23+
SetuptoolsDeprecationWarning
24+
)
25+
1726
self._is_running = True
1827
try:
1928
orig.bdist_wininst.run(self)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""develop tests
2+
"""
3+
import mock
4+
5+
import pytest
6+
7+
from setuptools.dist import Distribution
8+
from setuptools import SetuptoolsDeprecationWarning
9+
10+
11+
@mock.patch("distutils.command.bdist_wininst.bdist_wininst")
12+
def test_bdist_wininst_warning(distutils_cmd):
13+
dist = Distribution(dict(
14+
script_name='setup.py',
15+
script_args=['bdist_wininst'],
16+
name='foo',
17+
py_modules=['hi'],
18+
))
19+
dist.parse_command_line()
20+
with pytest.warns(SetuptoolsDeprecationWarning):
21+
dist.run_commands()
22+
23+
distutils_cmd.run.assert_called_once()

0 commit comments

Comments
 (0)