Commit dd11802
authored
feat: discover uv-managed global Python installations (#380)
The `pet-uv` locator only discovered uv project/workspace virtual
environments (`.venv` with `pyvenv.cfg`). Python versions installed
globally via `uv python install` were not discovered by the Uv locator.
## Changes
- Scan the uv Python install directory (`UV_PYTHON_INSTALL_DIR`, or
platform defaults: `%APPDATA%\uv\python` on Windows,
`~/.local/share/uv/python` on Unix)
- Enumerate subdirectories matching uv's naming convention
(`cpython-X.Y.Z-os-arch-libc`)
- Skip symlinks (Unix) and junctions (Windows) to avoid duplicating
minor-version aliases
- Identify executables under the uv install directory via `try_from()`
- Parse version from directory names with validation (minimum `X.Y`
format)
- Pass `Environment` to `Uv::from()` for env var access
Fixes #3791 parent e2aa966 commit dd11802
File tree
4 files changed
+386
-3
lines changed- crates
- pet-uv
- src
- pet/src
4 files changed
+386
-3
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments