mirror of https://github.com/pypa/pip
Tweak two use_pep517 identity checks. (#6135)
This commit is contained in:
parent
47d7f2b92e
commit
35b1cc1c97
|
@ -57,17 +57,20 @@ def load_pyproject_toml(
|
||||||
build_system = None
|
build_system = None
|
||||||
|
|
||||||
# The following cases must use PEP 517
|
# The following cases must use PEP 517
|
||||||
# We check for use_pep517 equalling False because that
|
# We check for use_pep517 being non-None and falsey because that means
|
||||||
# means the user explicitly requested --no-use-pep517
|
# the user explicitly requested --no-use-pep517. The value 0 as
|
||||||
|
# opposed to False can occur when the value is provided via an
|
||||||
|
# environment variable or config file option (due to the quirk of
|
||||||
|
# strtobool() returning an integer in pip's configuration code).
|
||||||
if has_pyproject and not has_setup:
|
if has_pyproject and not has_setup:
|
||||||
if use_pep517 is False:
|
if use_pep517 is not None and not use_pep517:
|
||||||
raise InstallationError(
|
raise InstallationError(
|
||||||
"Disabling PEP 517 processing is invalid: "
|
"Disabling PEP 517 processing is invalid: "
|
||||||
"project does not have a setup.py"
|
"project does not have a setup.py"
|
||||||
)
|
)
|
||||||
use_pep517 = True
|
use_pep517 = True
|
||||||
elif build_system and "build-backend" in build_system:
|
elif build_system and "build-backend" in build_system:
|
||||||
if use_pep517 is False:
|
if use_pep517 is not None and not use_pep517:
|
||||||
raise InstallationError(
|
raise InstallationError(
|
||||||
"Disabling PEP 517 processing is invalid: "
|
"Disabling PEP 517 processing is invalid: "
|
||||||
"project specifies a build backend of {} "
|
"project specifies a build backend of {} "
|
||||||
|
|
Loading…
Reference in New Issue