Skip to content

Commit 60be5bd

Browse files
committed
In deprecated setup.py install, fall back to distutils.
Instead of failing when easy_install isn't present. Closes #3143
1 parent 6c748ca commit 60be5bd

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

newsfragments/3143.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In deprecated setup.py install, fall back to distutils.

setuptools/command/install.py

+2-22
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ def initialize_options(self):
6363
standards-based tools.
6464
""",
6565
see_url="https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html",
66-
# TODO: Document how to bootstrap setuptools without install
67-
# (e.g. by unzipping the wheel file)
68-
# and then add a due_date to this warning.
66+
due_date=(2025, 10, 31),
6967
)
7068

7169
super().initialize_options()
@@ -74,9 +72,7 @@ def initialize_options(self):
7472

7573
def finalize_options(self) -> None:
7674
super().finalize_options()
77-
if self.root:
78-
self.single_version_externally_managed = True
79-
elif self.single_version_externally_managed:
75+
if self.single_version_externally_managed:
8076
if not self.root and not self.record:
8177
raise DistutilsArgError(
8278
"You must specify --record or --root when building system packages"
@@ -93,19 +89,6 @@ def handle_extra_path(self):
9389
self.extra_dirs = ''
9490
return None
9591

96-
def run(self):
97-
# Explicit request for old-style install? Just do it
98-
if self.old_and_unmanageable or self.single_version_externally_managed:
99-
return super().run()
100-
101-
if not self._called_from_setup(inspect.currentframe()):
102-
# Run in backward-compatibility mode to support bdist_* commands.
103-
super().run()
104-
else:
105-
self.do_egg_install()
106-
107-
return None
108-
10992
@staticmethod
11093
def _called_from_setup(run_frame):
11194
"""
@@ -139,9 +122,6 @@ def _called_from_setup(run_frame):
139122

140123
return False
141124

142-
def do_egg_install(self) -> None:
143-
raise NotImplementedError("Support for egg-based install has been removed.")
144-
145125

146126
# XXX Python 3.1 doesn't see _nc if this is inside the class
147127
install.sub_commands = [

0 commit comments

Comments
 (0)