summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-11-14 03:35:15 -0500
committerJason R. Coombs <jaraco@jaraco.com>2021-11-14 12:50:13 -0500
commit0fc3bc079b8fec1662e6e0df540490e4198d6862 (patch)
tree02e866c694ff56ba57bdfea0ae3cb5193683643b
parentd212daa48743609fc439d8f5cbb2b4e8effbd55f (diff)
downloadpython-setuptools-git-feature/deprecate-installer.tar.gz
Reduce scope of setup_requires deprecation to only deprecate the installation of these requirements, but still honor setup_requires in PEP 517 installers. Fixes #2877.feature/deprecate-installer
-rw-r--r--changelog.d/2877.change.rst1
-rw-r--r--pytest.ini2
-rw-r--r--setuptools/__init__.py6
-rw-r--r--setuptools/installer.py7
4 files changed, 9 insertions, 7 deletions
diff --git a/changelog.d/2877.change.rst b/changelog.d/2877.change.rst
new file mode 100644
index 00000000..d6040518
--- /dev/null
+++ b/changelog.d/2877.change.rst
@@ -0,0 +1 @@
+Back out deprecation of setup_requires and replace instead by a deprecation of setuptools.installer and fetch_build_egg. Now setup_requires is still supported when installed as part of a PEP 517 build, but is deprecated when an unsatisfied requirement is encountered.
diff --git a/pytest.ini b/pytest.ini
index df1c2af9..8cc1052d 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -26,7 +26,7 @@ filterwarnings=
ignore:The Windows bytes API has been deprecated:DeprecationWarning
# https://github.com/pypa/setuptools/issues/2823
- ignore:setup_requires is deprecated.
+ ignore:setuptools.installer is deprecated.
# https://github.com/pypa/setuptools/issues/917
ignore:setup.py install is deprecated.
diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index a623262e..9d6f0bc0 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -4,7 +4,6 @@ from fnmatch import fnmatchcase
import functools
import os
import re
-import warnings
import _distutils_hack.override # noqa: F401
@@ -145,11 +144,6 @@ 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/installer.py b/setuptools/installer.py
index 57e2b587..b7096df1 100644
--- a/setuptools/installer.py
+++ b/setuptools/installer.py
@@ -3,11 +3,13 @@ import os
import subprocess
import sys
import tempfile
+import warnings
from distutils import log
from distutils.errors import DistutilsError
import pkg_resources
from setuptools.wheel import Wheel
+from ._deprecation_warning import SetuptoolsDeprecationWarning
def _fixup_find_links(find_links):
@@ -22,6 +24,11 @@ def fetch_build_egg(dist, req): # noqa: C901 # is too complex (16) # FIXME
"""Fetch an egg needed for building.
Use pip/wheel to fetch/build a wheel."""
+ warnings.warn(
+ "setuptools.installer is deprecated. Requirements should "
+ "be satisfied by a PEP 517 installer.",
+ SetuptoolsDeprecationWarning,
+ )
# Warn if wheel is not available
try:
pkg_resources.get_distribution('wheel')