uv
79ad7a1a - Use a stable directory for (local) script virtual environments (#11347)

Commit
307 days ago
Use a stable directory for (local) script virtual environments (#11347) ## Summary Today, scripts use `CachedEnvironment`, which results in a different virtual environment path every time the interpreter changes _or_ the project requirements change. This makes it impossible to provide users with a stable path to the script that they can use for (e.g.) directing their editor. This PR modifies `uv run` to use a stable path for local scripts (we continue to use `CachedEnvironment` for remote scripts and scripts from `stdin`). The logic now looks a lot more like it does for projects: we `get_or_init` an environment, etc. For now, the path to the script is like: `environments-v1/4485801245a4732f`, where `4485801245a4732f` is a SHA of the absolute path to the script. But I'm not picky on that :)
Author
Parents
Loading