From fc5c3083908170e1cbfd1dec91f87a3e2707e3fa Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 22 Oct 2021 15:27:51 -0400 Subject: [PATCH] Deprecate setup.py install and easy_install. Ref #917. --- changelog.d/917.change.rst | 1 + pytest.ini | 4 ++++ setuptools/command/easy_install.py | 6 ++++++ setuptools/command/install.py | 7 +++++++ 4 files changed, 18 insertions(+) create mode 100644 changelog.d/917.change.rst diff --git a/changelog.d/917.change.rst b/changelog.d/917.change.rst new file mode 100644 index 0000000000..a2d3f7b8d2 --- /dev/null +++ b/changelog.d/917.change.rst @@ -0,0 +1 @@ +``setup.py install`` and ``easy_install`` commands are now officially deprecated. Use other standards-based installers (like pip) and builders (like build). Workloads reliant on this behavior should pin to this major version of Setuptools. diff --git a/pytest.ini b/pytest.ini index f81b6cfb3b..c7b62cc657 100644 --- a/pytest.ini +++ b/pytest.ini @@ -29,3 +29,7 @@ filterwarnings= # https://github.com/pypa/setuptools/issues/2823 ignore:setup_requires is deprecated. + + # https://github.com/pypa/setuptools/issues/917 + ignore:setup.py install is deprecated. + ignore:easy_install command is deprecated. diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b88c3e9a5a..1aed0e8703 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -153,6 +153,12 @@ class easy_install(Command): create_index = PackageIndex def initialize_options(self): + warnings.warn( + "easy_install command is deprecated. " + "Use build and pip and other standards-based tools.", + EasyInstallDeprecationWarning, + ) + # the --user option seems to be an opt-in one, # so the default should be False. self.user = 0 diff --git a/setuptools/command/install.py b/setuptools/command/install.py index 72b9a3e424..35e54d2043 100644 --- a/setuptools/command/install.py +++ b/setuptools/command/install.py @@ -30,6 +30,13 @@ class install(orig.install): _nc = dict(new_commands) def initialize_options(self): + + warnings.warn( + "setup.py install is deprecated. " + "Use build and pip and other standards-based tools.", + setuptools.SetuptoolsDeprecationWarning, + ) + orig.install.initialize_options(self) self.old_and_unmanageable = None self.single_version_externally_managed = None