1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Isolate when pyproject.toml does not have build-system.requires

This commit is contained in:
Pradyun Gedam 2018-07-09 07:48:36 +05:30
parent 3e7e7d349a
commit e3b06f9e51
No known key found for this signature in database
GPG key ID: DA17C4B29CB32E4B
2 changed files with 12 additions and 7 deletions

View file

@ -585,16 +585,17 @@ class InstallRequirement(object):
if requires is None:
logging.warn(template, self, "it is missing.")
warnings.warn(
"Future versions of pip will reject packages with "
"pyproject.toml files that do not comply with PEP 518.",
"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.",
RemovedInPip12Warning,
)
# NOTE: Currently allowing projects to skip this key so that they
# can transition to a PEP 518 compliant pyproject.toml or
# push to update the PEP.
# Come pip 19.0, bring this to compliance with PEP 518.
return None
# 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.
return ["setuptools", "wheel"]
else:
# Error out if it's not a list of strings
is_list_of_str = isinstance(requires, list) and all(

View file

@ -55,6 +55,10 @@ def test_pep518_allows_but_warns_missing_requires(script, data, common_wheels):
)
assert "does not comply with PEP 518" in result.stderr
assert "DEPRECATION" in result.stderr
# We want it to go through isolation for now.
assert "Installing build dependencies" in result.stdout, result.stdout
assert result.returncode == 0
assert result.files_created