Skip to content

Commit 89068c6

Browse files
authored
Deprecation warning for setuptools.command._install (#4727)
2 parents 832c850 + cd4836f commit 89068c6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

setuptools/command/install.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@
2121
else:
2222
easy_install_cls = None
2323

24-
# Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for
25-
# now. See https://github.com/pypa/setuptools/issues/199/
26-
_install = orig.install
24+
25+
def __getattr__(name: str): # pragma: no cover
26+
if name == "_install":
27+
SetuptoolsDeprecationWarning.emit(
28+
"`setuptools.command._install` was an internal implementation detail "
29+
+ "that was left in for numpy<1.9 support.",
30+
due_date=(2025, 5, 2), # Originally added on 2024-11-01
31+
)
32+
return orig.install
33+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
2734

2835

2936
class install(orig.install):

0 commit comments

Comments
 (0)