From 4babc076631d5ac48a0f9573fff406ab2dd6b6e4 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Fri, 28 Jul 2023 15:32:29 +0800 Subject: [PATCH] Move metadata-fetching log to VERBOSE level --- news/12155.process.rst | 6 ++++++ src/pip/_internal/operations/prepare.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 news/12155.process.rst diff --git a/news/12155.process.rst b/news/12155.process.rst new file mode 100644 index 00000000000..5f77231c864 --- /dev/null +++ b/news/12155.process.rst @@ -0,0 +1,6 @@ +The metadata-fetching log message is moved to the VERBOSE level and now hidden +by default. The more significant information in this message to most users are +already available in surrounding logs (the package name and version of the +metadata being fetched), while the URL to the exact metadata file is generally +too long and clutters the output. The message can be brought back with +``--verbose``. diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index cb121bcb252..c07b261fd3b 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -4,7 +4,6 @@ # The following comment should be removed at some point in the future. # mypy: strict-optional=False -import logging import mimetypes import os import shutil @@ -37,6 +36,7 @@ from pip._internal.network.session import PipSession from pip._internal.operations.build.build_tracker import BuildTracker from pip._internal.req.req_install import InstallRequirement +from pip._internal.utils._log import getLogger from pip._internal.utils.direct_url_helpers import ( direct_url_for_editable, direct_url_from_link, @@ -53,7 +53,7 @@ from pip._internal.utils.unpacking import unpack_file from pip._internal.vcs import vcs -logger = logging.getLogger(__name__) +logger = getLogger(__name__) def _get_prepared_distribution( @@ -394,7 +394,7 @@ def _fetch_metadata_using_link_data_attr( if metadata_link is None: return None assert req.req is not None - logger.info( + logger.verbose( "Obtaining dependency information for %s from %s", req.req, metadata_link,