Skip to content

Commit

Permalink
Merge pull request #12295 from hauntsaninja/legacy-resol
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored Apr 23, 2024
2 parents 40c112a + c4e03f3 commit e812942
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Empty file.
9 changes: 5 additions & 4 deletions src/pip/_internal/resolution/legacy/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
a. "first found, wins" (where the order is breadth first)
"""

# The following comment should be removed at some point in the future.
# mypy: strict-optional=False

import logging
import sys
from collections import defaultdict
Expand Down Expand Up @@ -52,7 +49,7 @@

logger = logging.getLogger(__name__)

DiscoveredDependencies = DefaultDict[str, List[InstallRequirement]]
DiscoveredDependencies = DefaultDict[Optional[str], List[InstallRequirement]]


def _check_dist_requires_python(
Expand Down Expand Up @@ -321,6 +318,7 @@ def _set_req_to_reinstall(self, req: InstallRequirement) -> None:
"""
# Don't uninstall the conflict if doing a user install and the
# conflict is not a user install.
assert req.satisfied_by is not None
if not self.use_user_site or req.satisfied_by.in_usersite:
req.should_reinstall = True
req.satisfied_by = None
Expand Down Expand Up @@ -419,6 +417,8 @@ def _populate_link(self, req: InstallRequirement) -> None:

if self.wheel_cache is None or self.preparer.require_hashes:
return

assert req.link is not None, "_find_requirement_link unexpectedly returned None"
cache_entry = self.wheel_cache.get_cache_entry(
link=req.link,
package_name=req.name,
Expand Down Expand Up @@ -532,6 +532,7 @@ def add_req(subreq: Requirement, extras_requested: Iterable[str]) -> None:
with indent_log():
# We add req_to_install before its dependencies, so that we
# can refer to it when adding dependencies.
assert req_to_install.name is not None
if not requirement_set.has_requirement(req_to_install.name):
# 'unnamed' requirements will get added here
# 'unnamed' requirements can only come from being directly
Expand Down

0 comments on commit e812942

Please sign in to comment.