diff --git a/news/5416.bugfix b/news/5416.bugfix deleted file mode 100644 index f5aff2abe..000000000 --- a/news/5416.bugfix +++ /dev/null @@ -1 +0,0 @@ -Warn when a project's pyproject.toml file does not contain ``build-system.requires``. diff --git a/news/5512.bugfix b/news/5512.bugfix deleted file mode 100644 index f5aff2abe..000000000 --- a/news/5512.bugfix +++ /dev/null @@ -1 +0,0 @@ -Warn when a project's pyproject.toml file does not contain ``build-system.requires``. diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index efe96a774..b9b6ab3a0 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -32,7 +32,6 @@ from pip._internal.locations import ( PIP_DELETE_MARKER_FILENAME, running_under_virtualenv, ) from pip._internal.req.req_uninstall import UninstallPathSet -from pip._internal.utils.deprecation import deprecated from pip._internal.utils.hashes import Hashes from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( @@ -574,26 +573,10 @@ class InstallRequirement(object): # Extract the build requirements requires = pp_toml.get("build-system", {}).get("requires", None) - template = ( - "%s does not comply with PEP 518 since pyproject.toml " - "does not contain a valid '[build-system].requires' key: %s" - ) - if requires is None: - logging.warn(template, self, "it is missing.") - deprecated( - "Future versions of pip may reject packages with " - "pyproject.toml files that do not contain the [build-system]" - "table and the requires key, as specified in PEP 518.", - replacement=None, - gone_in="18.2", - issue=5416, - ) - - # Currently, we're isolating the build based on the presence of the - # pyproject.toml file. If the user doesn't specify - # build-system.requires, assume they intended to use setuptools and - # wheel for now. + # We isolate on the presence of the pyproject.toml file. + # If build-system.requires is not specified, treat it as if it was + # specified as ["setuptools", "wheel"] return ["setuptools", "wheel"] else: # Error out if it's not a list of strings @@ -601,8 +584,12 @@ class InstallRequirement(object): isinstance(req, six.string_types) for req in requires ) if not is_list_of_str: + template = ( + "{} does not comply with PEP 518 since pyproject.toml " + "does not contain a valid build-system.requires key: {}" + ) raise InstallationError( - template % (self, "it is not a list of strings.") + template.format(self, "it is not a list of strings.") ) # If control flow reaches here, we're good to go. diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py index 201d9a6a9..9ccaf9e8c 100644 --- a/tests/functional/test_install.py +++ b/tests/functional/test_install.py @@ -47,14 +47,14 @@ def test_pep518_refuses_invalid_requires(script, data, common_wheels): assert "does not comply with PEP 518" in result.stderr -def test_pep518_allows_but_warns_missing_requires(script, data, common_wheels): +def test_pep518_allows_missing_requires(script, data, common_wheels): result = script.pip( 'install', '-f', common_wheels, data.src.join("pep518_missing_requires"), expect_stderr=True ) - assert "does not comply with PEP 518" in result.stderr - assert "DEPRECATION" in result.stderr + # Make sure we don't warn when this occurs. + assert "does not comply with PEP 518" not in result.stderr # We want it to go through isolation for now. assert "Installing build dependencies" in result.stdout, result.stdout