def METHOD_NAME(
    self, cmds: t.Sequence[str], *, env: dict[str, str], cwd: PathType
) -> subprocess.CompletedProcess[bytes]:
    proc = subprocess.Popen(
        cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, cwd=cwd
    )
    queue: Queue[tuple[str, bytes]] = Queue()
    stderr, stdout = b"", b""
    # We will use a thread to read from the subprocess and avoid hanging from Ctrl+C
    t = Thread(target=self._enqueue_output, args=(proc.stdout, "stdout", queue))
    t.daemon = True
    t.start()
    t = Thread(target=self._enqueue_output, args=(proc.stderr, "stderr", queue))
    t.daemon = True
    t.start()
    for _ in range(2):
        for src, line in iter(queue.get, None):
            logger.info(line.decode(errors="replace").strip("\n"))
            if src == "stderr":
                stderr += line
            else:
                stdout += line
    exit_code = proc.wait()
    if exit_code != 0:
        raise subprocess.CalledProcessError(
            exit_code, cmds, output=stdout, stderr=stderr
        )
    return subprocess.CompletedProcess(
        proc.args, exit_code, stdout=stdout, stderr=stderr
    )