Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor setuptools 67.7.2 #11997

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/setuptools.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade setuptools to 67.7.2
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"
)
Comment on lines +50 to +56
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this also filter out pip._internal.metadata.pkg_resources? It’s probably fine since we probably won’t deprecate anything in that module anyway (any new development happens in the importlib.metadata backend instead), but I just want to clarify this in case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would. Ideally, I'd have made the filter just on pip._vendor.pkg_resources, but that wouldn't have handled the devendoring case. I could have had 2 separate filters, or even left it for whoever does the devendoring to sort out, but that seems unnecessarily unfriendly.

I'd be fine with someone submitting a PR to tighten this up (I didn't even think of pip._internal.metadata.pkg_resources), but like you I think it's probably fine as it is.


# Configure our deprecation warnings to be sent through loggers
deprecation.install_warning_logger()

Expand Down
Loading