From 0fc3bc079b8fec1662e6e0df540490e4198d6862 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 14 Nov 2021 03:35:15 -0500 Subject: 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. --- setuptools/__init__.py | 6 ------ setuptools/installer.py | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'setuptools') 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') -- cgit v1.2.1