Skip to content

Commit

Permalink
chore(deps): update resolvelib to 1.1.0 (#3235)
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Oct 31, 2024
1 parent 4401ff5 commit efaccb8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
1 change: 1 addition & 0 deletions news/3235.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update `resolvelib` to 1.1.0.
7 changes: 4 additions & 3 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions src/pdm/resolver/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def wrapper(cls: ProviderT) -> ProviderT:


@register_provider("all")
class BaseProvider(AbstractProvider):
class BaseProvider(AbstractProvider[Requirement, Candidate, str]):
def __init__(
self,
repository: BaseRepository,
Expand All @@ -71,7 +71,6 @@ def __init__(
self.excludes = {normalize_name(k) for k in project.pyproject.resolution.get("excludes", [])}
self.direct_minimal_versions = direct_minimal_versions
self.locked_candidates = locked_candidates
self._known_depth: dict[str, int] = {}

def requirement_preference(self, requirement: Requirement) -> Comparable:
"""Return the preference of a requirement to find candidates.
Expand Down Expand Up @@ -102,14 +101,6 @@ def get_preference(
backtrack_identifiers = {req.identify() for req, _ in backtrack_causes} | {
parent.identify() for _, parent in backtrack_causes if parent is not None
}
if is_top:
dep_depth = 1
else:
parent_depths = (
self._known_depth[parent.identify()] if parent is not None else 0
for _, parent in information[identifier]
)
dep_depth = min(parent_depths, default=0) + 1
# Use the REAL identifier as it may be updated after candidate preparation.
deps: list[Requirement] = []
for candidate in candidates[identifier]:
Expand All @@ -118,7 +109,6 @@ def get_preference(
except RequirementsConflicted:
continue
break
self._known_depth[self.identify(candidate)] = dep_depth
is_backtrack_cause = any(dep.identify() in backtrack_identifiers for dep in deps)
is_file_or_url = any(not requirement.is_named for requirement, _ in information[identifier])
operators = [spec.operator for req, _ in information[identifier] for spec in req.specifier]
Expand All @@ -131,7 +121,6 @@ def get_preference(
not is_file_or_url,
not is_pinned,
not is_backtrack_cause,
dep_depth,
-constraints,
identifier,
)
Expand Down

0 comments on commit efaccb8

Please sign in to comment.