From 042d64cd00a23370dd2fdc06891caf969bdf9782 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Thu, 14 Mar 2024 17:34:33 +0000 Subject: [PATCH] Pass -vv to pip subprocess Fixes #12577 This looks like it was an oversight in #9450 - we should pass the correct verbosity level to build env install subprocesses. Tested with: ``` rm -rf ~/.cache/pip && rm -f *.whl && pip wheel --no-binary :all: hatchling ``` and all three verbosity levels, before and after this change, giving the following logs: ``` 33 patched-verbosity0.log 2549 patched-verbosity1.log 11938 patched-verbosity2.log 33 unpatched-verbosity0.log 99 unpatched-verbosity1.log 1030 unpatched-verbosity2.log ``` i.e. currently a lot of useful logs are being dropped from these install subprocesess even with -vvv --- news/12577.bugfix.rst | 1 + src/pip/_internal/build_env.py | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 news/12577.bugfix.rst diff --git a/news/12577.bugfix.rst b/news/12577.bugfix.rst new file mode 100644 index 00000000000..bb359a32ff8 --- /dev/null +++ b/news/12577.bugfix.rst @@ -0,0 +1 @@ +Ensure `-vv` gets passed to any ``pip install`` build environment subprocesses. diff --git a/src/pip/_internal/build_env.py b/src/pip/_internal/build_env.py index 4f704a3547d..838de86474f 100644 --- a/src/pip/_internal/build_env.py +++ b/src/pip/_internal/build_env.py @@ -19,6 +19,7 @@ from pip._internal.cli.spinners import open_spinner from pip._internal.locations import get_platlib, get_purelib, get_scheme from pip._internal.metadata import get_default_environment, get_environment +from pip._internal.utils.logging import VERBOSE from pip._internal.utils.subprocess import call_subprocess from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds @@ -242,6 +243,8 @@ def _install_requirements( "--no-warn-script-location", ] if logger.getEffectiveLevel() <= logging.DEBUG: + args.append("-vv") + elif logger.getEffectiveLevel() <= VERBOSE: args.append("-v") for format_control in ("no_binary", "only_binary"): formats = getattr(finder.format_control, format_control)