From f56ec327b92ebe836e63e07cb2449a20e09dec38 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Fri, 30 Apr 2021 09:29:27 +0800 Subject: [PATCH] Make location mismatch messages DEBUG level --- news/9912.removal.rst | 4 ++++ src/pip/_internal/locations/__init__.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 news/9912.removal.rst diff --git a/news/9912.removal.rst b/news/9912.removal.rst new file mode 100644 index 00000000000..4ec0832ed74 --- /dev/null +++ b/news/9912.removal.rst @@ -0,0 +1,4 @@ +Temporarily set the new "Value for ... does not match" location warnings level +to *DEBUG*, to hide them from casual users. This prepares pip 21.1 for CPython +inclusion, while pip maintainers digest the first intake of location mismatch +issues for the ``distutils``-``sysconfig`` trasition. diff --git a/src/pip/_internal/locations/__init__.py b/src/pip/_internal/locations/__init__.py index 18bf0319f3d..3acb51bc454 100644 --- a/src/pip/_internal/locations/__init__.py +++ b/src/pip/_internal/locations/__init__.py @@ -51,7 +51,7 @@ def _warn_if_mismatch(old: pathlib.Path, new: pathlib.Path, *, key: str) -> bool "\ndistutils: %s" "\nsysconfig: %s" ) - logger.warning(message, key, issue_url, old, new) + logger.debug(message, key, issue_url, old, new) return True @@ -65,7 +65,7 @@ def _log_context( message = ( "Additional context:" "\nuser = %r" "\nhome = %r" "\nroot = %r" "\nprefix = %r" ) - logger.warning(message, user, home, root, prefix) + logger.debug(message, user, home, root, prefix) def get_scheme(