Skip to content

Commit 35b1cc1

Browse files
authored
Tweak two use_pep517 identity checks. (#6135)
1 parent 47d7f2b commit 35b1cc1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/pip/_internal/pyproject.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,20 @@ def load_pyproject_toml(
5757
build_system = None
5858

5959
# The following cases must use PEP 517
60-
# We check for use_pep517 equalling False because that
61-
# means the user explicitly requested --no-use-pep517
60+
# We check for use_pep517 being non-None and falsey because that means
61+
# the user explicitly requested --no-use-pep517. The value 0 as
62+
# opposed to False can occur when the value is provided via an
63+
# environment variable or config file option (due to the quirk of
64+
# strtobool() returning an integer in pip's configuration code).
6265
if has_pyproject and not has_setup:
63-
if use_pep517 is False:
66+
if use_pep517 is not None and not use_pep517:
6467
raise InstallationError(
6568
"Disabling PEP 517 processing is invalid: "
6669
"project does not have a setup.py"
6770
)
6871
use_pep517 = True
6972
elif build_system and "build-backend" in build_system:
70-
if use_pep517 is False:
73+
if use_pep517 is not None and not use_pep517:
7174
raise InstallationError(
7275
"Disabling PEP 517 processing is invalid: "
7376
"project specifies a build backend of {} "

0 commit comments

Comments
 (0)