Skip to content

Commit d7f0bde

Browse files
committed
remove jedi cache before warming up
1 parent 604d90b commit d7f0bde

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/jedi_cache.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
""" utility script to warm up/validate the jedi cache
22
"""
3+
import pathlib
4+
import shutil
35
import sys
46
import time
57

@@ -31,11 +33,14 @@ def warm_up_one(module):
3133

3234

3335
if __name__ == "__main__":
36+
jedi_cache = pathlib.Path(jedi.settings.cache_directory)
37+
if jedi_cache.exists():
38+
shutil.rmtree(jedi_cache)
3439
print(IPython.__version__)
3540
print(jupyterlab.__version__)
3641
start = time.time()
3742
modules = sorted(set(sys.argv[1:] or MODULES_TO_CACHE))
3843
[warm_up_one(module) for module in modules]
3944
end = time.time()
4045
print("------------------")
41-
print(len(modules), "modules", end - start)
46+
print(len(modules), "modules in", jedi.settings.cache_directory, end - start)

0 commit comments

Comments
 (0)