Skip to content

Commit a88effe

Browse files
committed
Cache PackageFinder.find_all_candidates()
1 parent a8a0d07 commit a88effe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pip/_internal/index/package_finder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from pip._internal.models.selection_prefs import SelectionPreferences
2626
from pip._internal.models.target_python import TargetPython
2727
from pip._internal.models.wheel import Wheel
28+
from pip._internal.utils.compat import lru_cache
2829
from pip._internal.utils.filetypes import WHEEL_EXTENSION
2930
from pip._internal.utils.logging import indent_log
3031
from pip._internal.utils.misc import build_netloc
@@ -808,6 +809,7 @@ def process_project_url(self, project_url, link_evaluator):
808809

809810
return package_links
810811

812+
@lru_cache(maxsize=None)
811813
def find_all_candidates(self, project_name):
812814
# type: (str) -> List[InstallationCandidate]
813815
"""Find all available InstallationCandidate for project_name

0 commit comments

Comments
 (0)