WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit efaccb8

Browse files
authored
chore(deps): update resolvelib to 1.1.0 (#3235)
Signed-off-by: Frost Ming <[email protected]>
1 parent 4401ff5 commit efaccb8

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

news/3235.misc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update `resolvelib` to 1.1.0.

pdm.lock

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pdm/resolver/providers.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def wrapper(cls: ProviderT) -> ProviderT:
4646

4747

4848
@register_provider("all")
49-
class BaseProvider(AbstractProvider):
49+
class BaseProvider(AbstractProvider[Requirement, Candidate, str]):
5050
def __init__(
5151
self,
5252
repository: BaseRepository,
@@ -71,7 +71,6 @@ def __init__(
7171
self.excludes = {normalize_name(k) for k in project.pyproject.resolution.get("excludes", [])}
7272
self.direct_minimal_versions = direct_minimal_versions
7373
self.locked_candidates = locked_candidates
74-
self._known_depth: dict[str, int] = {}
7574

7675
def requirement_preference(self, requirement: Requirement) -> Comparable:
7776
"""Return the preference of a requirement to find candidates.
@@ -102,14 +101,6 @@ def get_preference(
102101
backtrack_identifiers = {req.identify() for req, _ in backtrack_causes} | {
103102
parent.identify() for _, parent in backtrack_causes if parent is not None
104103
}
105-
if is_top:
106-
dep_depth = 1
107-
else:
108-
parent_depths = (
109-
self._known_depth[parent.identify()] if parent is not None else 0
110-
for _, parent in information[identifier]
111-
)
112-
dep_depth = min(parent_depths, default=0) + 1
113104
# Use the REAL identifier as it may be updated after candidate preparation.
114105
deps: list[Requirement] = []
115106
for candidate in candidates[identifier]:
@@ -118,7 +109,6 @@ def get_preference(
118109
except RequirementsConflicted:
119110
continue
120111
break
121-
self._known_depth[self.identify(candidate)] = dep_depth
122112
is_backtrack_cause = any(dep.identify() in backtrack_identifiers for dep in deps)
123113
is_file_or_url = any(not requirement.is_named for requirement, _ in information[identifier])
124114
operators = [spec.operator for req, _ in information[identifier] for spec in req.specifier]
@@ -131,7 +121,6 @@ def get_preference(
131121
not is_file_or_url,
132122
not is_pinned,
133123
not is_backtrack_cause,
134-
dep_depth,
135124
-constraints,
136125
identifier,
137126
)

0 commit comments

Comments
 (0)