Skip to content

Commit

Permalink
Merge pull request #12755 from ichard26/cache-supported-tags
Browse files Browse the repository at this point in the history
Cache supported tags in resolver factory
  • Loading branch information
pfmoore authored Jun 27, 2024
2 parents 0d1cde3 + 47e82e2 commit 47ffcdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/12712.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improve dependency resolution performance by caching platform compatibility
tags during wheel cache lookup.
3 changes: 2 additions & 1 deletion src/pip/_internal/resolution/resolvelib/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def __init__(
self._extras_candidate_cache: Dict[
Tuple[int, FrozenSet[NormalizedName]], ExtrasCandidate
] = {}
self._supported_tags_cache = get_supported()

if not ignore_installed:
env = get_default_environment()
Expand Down Expand Up @@ -608,7 +609,7 @@ def get_wheel_cache_entry(
return self._wheel_cache.get_cache_entry(
link=link,
package_name=name,
supported_tags=get_supported(),
supported_tags=self._supported_tags_cache,
)

def get_dist_to_uninstall(self, candidate: Candidate) -> Optional[BaseDistribution]:
Expand Down

0 comments on commit 47ffcdd

Please sign in to comment.