1
- import collections
2
1
import math
3
2
from functools import lru_cache
4
3
from typing import (
@@ -100,7 +99,6 @@ def __init__(
100
99
self ._ignore_dependencies = ignore_dependencies
101
100
self ._upgrade_strategy = upgrade_strategy
102
101
self ._user_requested = user_requested
103
- self ._known_depths : Dict [str , float ] = collections .defaultdict (lambda : math .inf )
104
102
105
103
def identify (self , requirement_or_candidate : Union [Requirement , Candidate ]) -> str :
106
104
return requirement_or_candidate .name
@@ -157,23 +155,6 @@ def get_preference(
157
155
direct = candidate is not None
158
156
pinned = any (op [:2 ] == "==" for op in operators )
159
157
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
-
177
158
requested_order = self ._user_requested .get (identifier , math .inf )
178
159
179
160
# Requires-Python has only one candidate and the check is basically
@@ -190,7 +171,6 @@ def get_preference(
190
171
not direct ,
191
172
not pinned ,
192
173
not backtrack_cause ,
193
- inferred_depth ,
194
174
requested_order ,
195
175
not unfree ,
196
176
identifier ,
0 commit comments