diff options
author | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-04-21 19:02:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 19:02:14 +0000 |
commit | 92ca9eab30e1aececf4243d9a928cfe63f7dcfc9 (patch) | |
tree | 9c065aa521a5078df2565aab79caaf9f6be7e3f3 | |
parent | 53c284b325959a6fd177e9d37d8b5dd5824db2b3 (diff) | |
parent | 8487f1ae61f50578d9adb314429eb578e8e9f0c9 (diff) | |
download | external_python_setuptools-92ca9eab30e1aececf4243d9a928cfe63f7dcfc9.tar.gz external_python_setuptools-92ca9eab30e1aececf4243d9a928cfe63f7dcfc9.tar.bz2 external_python_setuptools-92ca9eab30e1aececf4243d9a928cfe63f7dcfc9.zip |
Merge pull request #2040 from hugovk/deprecate-bdist_wininst
Deprecate bdist_wininst
-rw-r--r-- | changelog.d/2040.change.rst | 1 | ||||
-rw-r--r-- | setuptools/command/bdist_wininst.py | 9 | ||||
-rw-r--r-- | setuptools/tests/test_bdist_deprecations.py | 23 |
3 files changed, 33 insertions, 0 deletions
diff --git a/changelog.d/2040.change.rst b/changelog.d/2040.change.rst new file mode 100644 index 00000000..b8f36f6f --- /dev/null +++ b/changelog.d/2040.change.rst @@ -0,0 +1 @@ +Deprecated the ``bdist_wininst`` command. Binary packages should be built as wheels instead. diff --git a/setuptools/command/bdist_wininst.py b/setuptools/command/bdist_wininst.py index 073de97b..ff4b6345 100644 --- a/setuptools/command/bdist_wininst.py +++ b/setuptools/command/bdist_wininst.py @@ -1,4 +1,7 @@ import distutils.command.bdist_wininst as orig +import warnings + +from setuptools import SetuptoolsDeprecationWarning class bdist_wininst(orig.bdist_wininst): @@ -14,6 +17,12 @@ class bdist_wininst(orig.bdist_wininst): return cmd def run(self): + warnings.warn( + "bdist_wininst is deprecated and will be removed in a future " + "version. Use bdist_wheel (wheel packages) instead.", + SetuptoolsDeprecationWarning + ) + self._is_running = True try: orig.bdist_wininst.run(self) diff --git a/setuptools/tests/test_bdist_deprecations.py b/setuptools/tests/test_bdist_deprecations.py new file mode 100644 index 00000000..704164aa --- /dev/null +++ b/setuptools/tests/test_bdist_deprecations.py @@ -0,0 +1,23 @@ +"""develop tests +""" +import mock + +import pytest + +from setuptools.dist import Distribution +from setuptools import SetuptoolsDeprecationWarning + + +@mock.patch("distutils.command.bdist_wininst.bdist_wininst") +def test_bdist_wininst_warning(distutils_cmd): + dist = Distribution(dict( + script_name='setup.py', + script_args=['bdist_wininst'], + name='foo', + py_modules=['hi'], + )) + dist.parse_command_line() + with pytest.warns(SetuptoolsDeprecationWarning): + dist.run_commands() + + distutils_cmd.run.assert_called_once() |