Repository: pypa/pip

Issue:
-vv is not passed to build env install subprocesses
### Description

While using `-vv` I noticed seeing a big pause between these two output lines:

`
      Installing backend dependencies: started
      Installing backend dependencies: finished with status 'done'
`

Clearly a lot of stuff was happening - like wheel building - but there was no output

It turns out that when -vv was introduced in #9450 this higher verbosity level was not passed onto these subprocesses

### Expected behavior

_No response_

### pip version

24.0

### Python version

3.9

### OS

RHEL

### How to Reproduce

Compare the logging output from

```
rm -rf ~/.cache/pip && rm -f *.whl && pip -vv wheel --no-binary :all: hatchling
```

before and after the patch. I'm seeing 1k lines before and 12k lines after.

### Output

_No response_

### Code of Conduct

- [X] I agree to follow the [PSF Code of Conduct](https://www.python.org/psf/conduct/).


Discussion:

Resolving patch:
diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py
--- a/src/pip/_internal/cli/cmdoptions.py
+++ b/src/pip/_internal/cli/cmdoptions.py
@@ -226,9 +226,9 @@ class PipOption(Option):
     "--progress-bar",
     dest="progress_bar",
     type="choice",
-    choices=["on", "off"],
+    choices=["on", "off", "raw"],
     default="on",
-    help="Specify whether the progress bar should be used [on, off] (default: on)",
+    help="Specify whether the progress bar should be used [on, off, raw] (default: on)",
 )
 
 log: Callable[..., Option] = partial(
diff --git a/src/pip/_internal/cli/progress_bars.py b/src/pip/_internal/cli/progress_bars.py
--- a/src/pip/_internal/cli/progress_bars.py
+++ b/src/pip/_internal/cli/progress_bars.py
@@ -1,4 +1,5 @@
 import functools
+import sys
 from typing import Callable, Generator, Iterable, Iterator, Optional, Tuple
 
 from pip._vendor.rich.progress import (
@@ -14,6 +15,7 @@
     TransferSpeedColumn,
 )
 
+from pip._internal.cli.spinners import RateLimiter
 from pip._internal.utils.logging import get_indentation
 
 DownloadProgressRenderer = Callable[[Iterable[bytes]], Iterator[bytes]]
@@ -55,6 +57,28 @@ def _rich_progress_bar(
             progress.update(task_id, advance=len(chunk))
 
 
+def _raw_progress_bar(
+    iterable: Iterable[bytes],
+    *,
+    size: Optional[int],
+) -> Generator[bytes, None, None]:
+    def write_progress(current: int, total: int) -> None:
+        sys.stdout.write("Progress %d of %d\n" % (current, total))
+        sys.stdout.flush()
+
+    current = 0
+    total = size or 0
+    rate_limiter = RateLimiter(0.25)
+
+    write_progress(current, total)
+    for chunk in iterable:
+        current += len(chunk)
+        if rate_limiter.ready() or current == total:
+            write_progress(current, total)
+            rate_limiter.reset()
+        yield chunk
+
+
 def get_download_progress_renderer(
     *, bar_type: str, size: Optional[int] = None
 ) -> DownloadProgressRenderer:
@@ -64,5 +88,7 @@ def get_download_progress_renderer(
     """
     if bar_type == "on":
         return functools.partial(_rich_progress_bar, bar_type=bar_type, size=size)
+    elif bar_type == "raw":
+        return functools.partial(_raw_progress_bar, size=size)
     else:
         return iter  # no-op, when passed an iterator


Test patch: