Skip to content

Commit 47ffcdd

Browse files
authored
Merge pull request #12755 from ichard26/cache-supported-tags
Cache supported tags in resolver factory
2 parents 0d1cde3 + 47e82e2 commit 47ffcdd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

news/12712.feature.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Improve dependency resolution performance by caching platform compatibility
2+
tags during wheel cache lookup.

src/pip/_internal/resolution/resolvelib/factory.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def __init__(
121121
self._extras_candidate_cache: Dict[
122122
Tuple[int, FrozenSet[NormalizedName]], ExtrasCandidate
123123
] = {}
124+
self._supported_tags_cache = get_supported()
124125

125126
if not ignore_installed:
126127
env = get_default_environment()
@@ -608,7 +609,7 @@ def get_wheel_cache_entry(
608609
return self._wheel_cache.get_cache_entry(
609610
link=link,
610611
package_name=name,
611-
supported_tags=get_supported(),
612+
supported_tags=self._supported_tags_cache,
612613
)
613614

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

0 commit comments

Comments
 (0)