diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-10-22 16:12:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-22 16:12:38 -0400 |
| commit | 391bb5d4d09c9eb8d6b2b98968e623455ae0a384 (patch) | |
| tree | 377d795c5a3cccc372d7e88bde17fcc689b0c4c8 | |
| parent | ce9cc34c020fac31a5e10e4b1ab4af3d66dc038c (diff) | |
| parent | fc5c3083908170e1cbfd1dec91f87a3e2707e3fa (diff) | |
| download | python-setuptools-git-391bb5d4d09c9eb8d6b2b98968e623455ae0a384.tar.gz | |
Merge pull request #2824 from pypa/debt/deprecate-setup-requires
Deprecate setup_requires, setup.py install, and easy_install command.
| -rw-r--r-- | changelog.d/2823.change.rst | 1 | ||||
| -rw-r--r-- | changelog.d/917.change.rst | 1 | ||||
| -rw-r--r-- | pytest.ini | 29 | ||||
| -rw-r--r-- | setuptools/__init__.py | 6 | ||||
| -rw-r--r-- | setuptools/command/easy_install.py | 6 | ||||
| -rw-r--r-- | setuptools/command/install.py | 7 |
6 files changed, 39 insertions, 11 deletions
diff --git a/changelog.d/2823.change.rst b/changelog.d/2823.change.rst new file mode 100644 index 00000000..69db4c0d --- /dev/null +++ b/changelog.d/2823.change.rst @@ -0,0 +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. diff --git a/changelog.d/917.change.rst b/changelog.d/917.change.rst new file mode 100644 index 00000000..a2d3f7b8 --- /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. @@ -8,21 +8,28 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 filterwarnings= - # Fail on warnings - error + # Fail on warnings + error - ## upstream + ## upstream # Suppress deprecation warning in flake8 ignore:SelectableGroups dict interface is deprecated::flake8 # Suppress deprecation warning in pypa/packaging#433 ignore:The distutils package is deprecated::packaging.tags ## end upstream - # https://github.com/pypa/setuptools/issues/1823 - ignore:bdist_wininst command is deprecated - # Suppress this error; unimportant for CI tests - ignore:Extraction path is writable by group/others:UserWarning - # Suppress weird RuntimeWarning. - ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning - # Suppress use of bytes for filenames on Windows until fixed #2016 - ignore:The Windows bytes API has been deprecated:DeprecationWarning + # https://github.com/pypa/setuptools/issues/1823 + ignore:bdist_wininst command is deprecated + # Suppress this error; unimportant for CI tests + ignore:Extraction path is writable by group/others:UserWarning + # Suppress weird RuntimeWarning. + ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning + # Suppress use of bytes for filenames on Windows until fixed #2016 + ignore:The Windows bytes API has been deprecated:DeprecationWarning + + # 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/__init__.py b/setuptools/__init__.py index 9d6f0bc0..a623262e 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -4,6 +4,7 @@ from fnmatch import fnmatchcase import functools import os import re +import warnings import _distutils_hack.override # noqa: F401 @@ -144,6 +145,11 @@ def _install_setup_requires(attrs): # Honor setup.cfg's options. dist.parse_config_files(ignore_option_errors=True) if dist.setup_requires: + warnings.warn( + "setup_requires is deprecated. Supply build " + "dependencies using PEP 517 pyproject.toml build-requires.", + SetuptoolsDeprecationWarning, + ) dist.fetch_build_eggs(dist.setup_requires) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b88c3e9a..1aed0e87 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 72b9a3e4..35e54d20 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 |
