diff options
author | Paul Moore <p.f.moore@gmail.com> | 2023-04-25 16:15:07 +0100 |
---|---|---|
committer | Paul Moore <p.f.moore@gmail.com> | 2023-04-25 16:15:07 +0100 |
commit | 4428130fbe44259562280f0601f034bb8c43bef2 (patch) | |
tree | fc999d32a0e452e91931d09b9fa86606b559b9e2 | |
parent | f1a7a6f942b869ae3428dbf55dfc1ca756c78d94 (diff) | |
download | pip-4428130fbe44259562280f0601f034bb8c43bef2.tar.gz |
Suppress pkg_resources deprecation warning
-rw-r--r-- | src/pip/_internal/cli/main.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pip/_internal/cli/main.py b/src/pip/_internal/cli/main.py index 0e3122154..7e061f5b3 100644 --- a/src/pip/_internal/cli/main.py +++ b/src/pip/_internal/cli/main.py @@ -4,6 +4,7 @@ import locale import logging import os import sys +import warnings from typing import List, Optional from pip._internal.cli.autocompletion import autocomplete @@ -46,6 +47,14 @@ def main(args: Optional[List[str]] = None) -> int: if args is None: args = sys.argv[1:] + # Suppress the pkg_resources deprecation warning + # Note - we use a module of .*pkg_resources to cover + # the normal case (pip._vendor.pkg_resources) and the + # devendored case (a bare pkg_resources) + warnings.filterwarnings( + action="ignore", category=DeprecationWarning, module=".*pkg_resources" + ) + # Configure our deprecation warnings to be sent through loggers deprecation.install_warning_logger() |