Skip to content

Commit e4d291c

Browse files
committed
Combine setuptools and wheel detection in one step
It would be annoying if you see an error about setuptools, install it, and only be greeted by another error telling you to install wheel. So we combine the two into one.
1 parent 8f52335 commit e4d291c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/pip/_internal/cli/cmdoptions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -785,13 +785,13 @@ def _handle_no_use_pep517(
785785

786786
# If user doesn't wish to use pep517, we check if setuptools and wheel are installed
787787
# and raise error if it is not.
788-
for package in ("setuptools", "wheel"):
789-
if not importlib.util.find_spec(package):
790-
msg = (
791-
f"It is not possible to use --no-use-pep517 "
792-
f"without {package} installed."
793-
)
794-
raise_option_error(parser, option=option, msg=msg)
788+
packages = ("setuptools", "wheel")
789+
if not all(importlib.util.find_spec(package) for package in packages):
790+
msg = (
791+
f"It is not possible to use --no-use-pep517 "
792+
f"without {' and '.join(packages)} installed."
793+
)
794+
raise_option_error(parser, option=option, msg=msg)
795795

796796
# Otherwise, --no-use-pep517 was passed via the command-line.
797797
parser.values.use_pep517 = False

0 commit comments

Comments
 (0)