Skip to content

Commit

Permalink
Pass -vv to pip subprocess
Browse files Browse the repository at this point in the history
Fixes pypa#12577

This looks like it was an oversight in pypa#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
  • Loading branch information
markmc committed Mar 20, 2024
1 parent 303fed3 commit 8d81de2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/12577.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure ``-vv`` gets passed to any ``pip install`` build environment subprocesses.
3 changes: 3 additions & 0 deletions src/pip/_internal/build_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8d81de2

Please sign in to comment.