perf: cache pip installed packages (#803)

This commit is contained in:
Vedat Baday
2024-11-03 04:13:37 +09:00
committed by GitHub
parent 825296c3e0
commit dc70f40eff
+2
View File
@@ -1,3 +1,4 @@
import functools
import os
import re
import shutil
@@ -70,6 +71,7 @@ def process_wrap(cmd_str, cwd=None, handler=None, env=None):
return process.wait()
@functools.cache
def get_installed_packages() -> Set[str]:
try:
result = subprocess.check_output([sys.executable, '-m', 'pip', 'list'], universal_newlines=True)