Skip to content

Commit

Permalink
Suppress pkg_resources deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmoore committed Apr 25, 2023
1 parent f1a7a6f commit 4428130
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pip/_internal/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import os
import sys
import warnings
from typing import List, Optional

from pip._internal.cli.autocompletion import autocomplete
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 4428130

Please sign in to comment.