Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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