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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading