Skip to content

Commit

Permalink
Disable PEP 658 for the legacy resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmoore committed Jul 18, 2023
1 parent 593b85f commit c12139d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/12156.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disable PEP 658 metadata fetching with the legacy resolver.
3 changes: 3 additions & 0 deletions src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def make_requirement_preparer(
"""
temp_build_dir_path = temp_build_dir.path
assert temp_build_dir_path is not None
legacy_resolver = False

resolver_variant = cls.determine_resolver_variant(options)
if resolver_variant == "2020-resolver":
Expand All @@ -300,6 +301,7 @@ def make_requirement_preparer(
"production."
)
else:
legacy_resolver = True
lazy_wheel = False
if "fast-deps" in options.features_enabled:
logger.warning(
Expand All @@ -320,6 +322,7 @@ def make_requirement_preparer(
use_user_site=use_user_site,
lazy_wheel=lazy_wheel,
verbosity=verbosity,
legacy_resolver=legacy_resolver,
)

@classmethod
Expand Down
9 changes: 9 additions & 0 deletions src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def __init__(
use_user_site: bool,
lazy_wheel: bool,
verbosity: int,
legacy_resolver: bool,
) -> None:
super().__init__()

Expand Down Expand Up @@ -259,6 +260,9 @@ def __init__(
# How verbose should underlying tooling be?
self.verbosity = verbosity

# Are we using the legacy resolver?
self.legacy_resolver = legacy_resolver

# Memoized downloaded files, as mapping of url: path.
self._downloaded: Dict[str, str] = {}

Expand Down Expand Up @@ -365,6 +369,11 @@ def _fetch_metadata_only(
self,
req: InstallRequirement,
) -> Optional[BaseDistribution]:
if self.legacy_resolver:
logger.debug(
"Metadata-only fetching is not used in the legacy resolver",
)
return None
if self.require_hashes:
logger.debug(
"Metadata-only fetching is not used as hash checking is required",
Expand Down

0 comments on commit c12139d

Please sign in to comment.