witty-laptop-37343
03/26/2023, 3:16 PMPANTS_NAMED_CACHES_DIR="/myProject/pants/named_caches"
when running pytest, I see that the libraries are loaded in
"/myProject/pants/named_caches/pex_root/venvs/s/4d6744fa/venv/lib/python3.9/....."
is there a way I could get the value “4d6744fa”enough-analyst-54434
03/26/2023, 3:33 PMenough-analyst-54434
03/26/2023, 3:37 PMwitty-laptop-37343
03/26/2023, 3:52 PMwitty-laptop-37343
03/26/2023, 3:55 PMenough-analyst-54434
03/26/2023, 4:13 PMwitty-laptop-37343
03/26/2023, 5:06 PMwitty-laptop-37343
03/26/2023, 5:06 PMenough-analyst-54434
03/26/2023, 5:11 PMimport x; x.__file__
to get the path of the library. However, that imports the broken library; so you need to unimport it (recursively) - no easy task in Python. That leads to the idea of running that step in a subprocess using sys.executable and retrieving the result by printing it to a piped stdout, for example. Super crazy. Can you not fork and patch the library instead or is the library not available via VCS?witty-laptop-37343
03/26/2023, 5:12 PMwitty-laptop-37343
03/26/2023, 5:13 PMenough-analyst-54434
03/26/2023, 5:13 PMenough-analyst-54434
03/26/2023, 5:13 PMwitty-laptop-37343
03/26/2023, 5:14 PMpants test ...
enough-analyst-54434
03/26/2023, 5:14 PMenough-analyst-54434
03/26/2023, 5:15 PMwitty-laptop-37343
03/26/2023, 5:15 PMwitty-laptop-37343
03/26/2023, 5:15 PM