-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
We can read the beginning of all entrypoints we created (through
entry_points.txt) and if any of them points to a python interpreter that doesn't exist, we invalidate the environment. There are some details to be figured out around perf and where the scripts come from, e.g. we don't cover non-entrypoint scripts (I don't think we keep a record of#!pythonscript we rewrote vs. script where the shebang was user-provided).Another approach is recording the venv location (either
pyvenv.cfgor a different file we create, iirc it's not recorded yet anywhere) and invalidating it if the original location and the current location aren't the same directory (usually, because the original location doesn't exist anymore, but we want to allow symlinks above the.venv).
Originally posted by @konstin in #13196
In projects, we can invalidate and recreate these environments. In other contexts, we can improve our error messages or warn.