Skip to content

Commit 391bb5d

Browse files
authored
Merge pull request #2824 from pypa/debt/deprecate-setup-requires
Deprecate setup_requires, setup.py install, and easy_install command.
2 parents ce9cc34 + fc5c308 commit 391bb5d

File tree

6 files changed

+39
-11
lines changed

6 files changed

+39
-11
lines changed

changelog.d/2823.change.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Officially deprecated support for ``setup_requires``. Users are encouraged instead to migrate to PEP 518 ``build-system.requires`` in ``pyproject.toml``. Users reliant on ``setup_requires`` should consider pinning to this major version to avoid disruption.

changelog.d/917.change.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

pytest.ini

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,28 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS
88
# workaround for warning pytest-dev/pytest#6178
99
junit_family=xunit2
1010
filterwarnings=
11-
# Fail on warnings
12-
error
11+
# Fail on warnings
12+
error
1313

14-
## upstream
14+
## upstream
1515
# Suppress deprecation warning in flake8
1616
ignore:SelectableGroups dict interface is deprecated::flake8
1717
# Suppress deprecation warning in pypa/packaging#433
1818
ignore:The distutils package is deprecated::packaging.tags
1919
## end upstream
2020

21-
# https://github.com/pypa/setuptools/issues/1823
22-
ignore:bdist_wininst command is deprecated
23-
# Suppress this error; unimportant for CI tests
24-
ignore:Extraction path is writable by group/others:UserWarning
25-
# Suppress weird RuntimeWarning.
26-
ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning
27-
# Suppress use of bytes for filenames on Windows until fixed #2016
28-
ignore:The Windows bytes API has been deprecated:DeprecationWarning
21+
# https://github.com/pypa/setuptools/issues/1823
22+
ignore:bdist_wininst command is deprecated
23+
# Suppress this error; unimportant for CI tests
24+
ignore:Extraction path is writable by group/others:UserWarning
25+
# Suppress weird RuntimeWarning.
26+
ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning
27+
# Suppress use of bytes for filenames on Windows until fixed #2016
28+
ignore:The Windows bytes API has been deprecated:DeprecationWarning
29+
30+
# https://github.com/pypa/setuptools/issues/2823
31+
ignore:setup_requires is deprecated.
32+
33+
# https://github.com/pypa/setuptools/issues/917
34+
ignore:setup.py install is deprecated.
35+
ignore:easy_install command is deprecated.

setuptools/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import functools
55
import os
66
import re
7+
import warnings
78

89
import _distutils_hack.override # noqa: F401
910

@@ -144,6 +145,11 @@ def finalize_options(self):
144145
# Honor setup.cfg's options.
145146
dist.parse_config_files(ignore_option_errors=True)
146147
if dist.setup_requires:
148+
warnings.warn(
149+
"setup_requires is deprecated. Supply build "
150+
"dependencies using PEP 517 pyproject.toml build-requires.",
151+
SetuptoolsDeprecationWarning,
152+
)
147153
dist.fetch_build_eggs(dist.setup_requires)
148154

149155

setuptools/command/easy_install.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ class easy_install(Command):
153153
create_index = PackageIndex
154154

155155
def initialize_options(self):
156+
warnings.warn(
157+
"easy_install command is deprecated. "
158+
"Use build and pip and other standards-based tools.",
159+
EasyInstallDeprecationWarning,
160+
)
161+
156162
# the --user option seems to be an opt-in one,
157163
# so the default should be False.
158164
self.user = 0

setuptools/command/install.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ class install(orig.install):
3030
_nc = dict(new_commands)
3131

3232
def initialize_options(self):
33+
34+
warnings.warn(
35+
"setup.py install is deprecated. "
36+
"Use build and pip and other standards-based tools.",
37+
setuptools.SetuptoolsDeprecationWarning,
38+
)
39+
3340
orig.install.initialize_options(self)
3441
self.old_and_unmanageable = None
3542
self.single_version_externally_managed = None

0 commit comments

Comments
 (0)