Skip to content

Commit

Permalink
Merge pull request #5585 from pradyunsg/pep-518/isolate-when-missing-…
Browse files Browse the repository at this point in the history
…requires

Isolate when pyproject.toml does not have build-system.requires
  • Loading branch information
pradyunsg authored Jul 9, 2018
2 parents 26014c5 + e3b06f9 commit da4d616
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,16 +585,17 @@ def get_pep_518_info(self):
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(
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit da4d616

Please sign in to comment.