|
1 | 1 | """ utility script to warm up/validate the jedi cache
|
| 2 | +what does it do: |
| 3 | +- Deletes the jedi cache (usually already empty on CI) |
| 4 | +- Imports a bunch of libraries |
| 5 | +- Prints out some versions, especially ones that are |
| 6 | + at times troublesome |
| 7 | +- Forces indexing all of the loaded libraries and their |
| 8 | + dependencies |
| 9 | +
|
| 10 | +why is this needed: |
| 11 | +- Before we had this, a couple of browser tests appeared |
| 12 | + "consistently flakier" than they were, as they were |
| 13 | + time-bounded by creating the jedi cache. |
| 14 | +- This was taking up to a minute to get a single |
| 15 | + completion value back |
| 16 | +- Further, were this cache to get corrupted (perhaps due to |
| 17 | + killing a running test :P) things go very mysteriously bad. |
| 18 | +- We need a way for the cache to be right before testing |
| 19 | +
|
| 20 | +how does it work: |
| 21 | +- When _using_ jedi for the first time, the cache gets |
| 22 | + created in `jedi.settings.cache_directory`, usually |
| 23 | + somewhere in $HOME. |
| 24 | +- As different libriraries are inspected by jedi, they get |
| 25 | + added to the cache. |
| 26 | +- This is very slow, especially on windows, and cannot |
| 27 | + feasibly be cached, today. |
| 28 | +- This script accelerates this process, so it can be done |
| 29 | + in a controlled manner rather than during some other test |
| 30 | +- also, by running it ahead of time, if the jedi dependency |
| 31 | + chain is broken in any way, this should help determine |
| 32 | + if faster, before trying to build everything |
| 33 | +
|
| 34 | +see more: |
| 35 | +- https://jedi.readthedocs.io/en/latest/docs/settings.html |
| 36 | +- https://github.com/krassowski/jupyterlab-lsp/pull/284 |
| 37 | +
|
2 | 38 | """
|
3 | 39 | import os
|
4 | 40 | import pathlib
|
|
0 commit comments