mirror of https://github.com/pypa/pip
Start rejecting pyproject.toml files with an empty build-system table
This commit is contained in:
parent
7fe759bdb1
commit
4d772e6cf6
|
@ -580,8 +580,18 @@ class InstallRequirement(object):
|
|||
if "build-system" not in pp_toml:
|
||||
return ["setuptools", "wheel"]
|
||||
|
||||
# Specifying the build-system table but not the requires key is invalid
|
||||
build_system = pp_toml["build-system"]
|
||||
if "requires" not in build_system:
|
||||
raise InstallationError(
|
||||
error_template.format(package=self, reason=(
|
||||
"it has a 'build-system' table but not the "
|
||||
"'build-system.requires' which is mandatory in the table"
|
||||
))
|
||||
)
|
||||
|
||||
# Error out if it's not a list of strings
|
||||
requires = build_system.get("requires", [])
|
||||
requires = build_system["requires"]
|
||||
if not _is_list_of_str(requires):
|
||||
raise InstallationError(error_template.format(
|
||||
self, "'build-system.requires' is not a list of strings."
|
||||
|
|
Loading…
Reference in New Issue