From dd3a3b5eb7c2319d77a0efa9a0b245883564f5b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 27 Jun 2020 15:50:29 +0700 Subject: [PATCH] Parallelize network operations in pip list --- news/8504.feature | 1 + src/pip/_internal/commands/list.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 news/8504.feature diff --git a/news/8504.feature b/news/8504.feature new file mode 100644 index 00000000000..06ab27112b6 --- /dev/null +++ b/news/8504.feature @@ -0,0 +1 @@ +Parallelize network operations in ``pip list``. diff --git a/src/pip/_internal/commands/list.py b/src/pip/_internal/commands/list.py index df9e1b38eda..35eff1c3593 100644 --- a/src/pip/_internal/commands/list.py +++ b/src/pip/_internal/commands/list.py @@ -19,6 +19,7 @@ write_output, ) from pip._internal.utils.packaging import get_installer +from pip._internal.utils.parallel import map_multithread from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: @@ -223,7 +224,7 @@ def latest_info(dist): dist.latest_filetype = typ return dist - for dist in map(latest_info, packages): + for dist in map_multithread(latest_info, packages): if dist is not None: yield dist