Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache supported tags in resolver factory #12755

Merged
merged 1 commit into from
Jun 27, 2024
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
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
Loading