Skip to content

Commit 9308566

Browse files
committed
Remove depth preference
1 parent 79ef1ce commit 9308566

File tree

2 files changed

+0
-98
lines changed

2 files changed

+0
-98
lines changed

src/pip/_internal/resolution/resolvelib/provider.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import collections
21
import math
32
from functools import lru_cache
43
from typing import (
@@ -100,7 +99,6 @@ def __init__(
10099
self._ignore_dependencies = ignore_dependencies
101100
self._upgrade_strategy = upgrade_strategy
102101
self._user_requested = user_requested
103-
self._known_depths: Dict[str, float] = collections.defaultdict(lambda: math.inf)
104102

105103
def identify(self, requirement_or_candidate: Union[Requirement, Candidate]) -> str:
106104
return requirement_or_candidate.name
@@ -157,23 +155,6 @@ def get_preference(
157155
direct = candidate is not None
158156
pinned = any(op[:2] == "==" for op in operators)
159157
unfree = bool(operators)
160-
161-
try:
162-
requested_order: Union[int, float] = self._user_requested[identifier]
163-
except KeyError:
164-
requested_order = math.inf
165-
if has_information:
166-
parent_depths = (
167-
self._known_depths[parent.name] if parent is not None else 0.0
168-
for _, parent in information[identifier]
169-
)
170-
inferred_depth = min(d for d in parent_depths) + 1.0
171-
else:
172-
inferred_depth = math.inf
173-
else:
174-
inferred_depth = 1.0
175-
self._known_depths[identifier] = inferred_depth
176-
177158
requested_order = self._user_requested.get(identifier, math.inf)
178159

179160
# Requires-Python has only one candidate and the check is basically
@@ -190,7 +171,6 @@ def get_preference(
190171
not direct,
191172
not pinned,
192173
not backtrack_cause,
193-
inferred_depth,
194174
requested_order,
195175
not unfree,
196176
identifier,

tests/unit/resolution_resolvelib/test_provider.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)