Skip to content

Commit dd11802

Browse files
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 #379
1 parent e2aa966 commit dd11802

File tree

4 files changed

+386
-3
lines changed

4 files changed

+386
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pet-uv/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ license.workspace = true
66

77
[dependencies]
88
pet-core = { path = "../pet-core" }
9+
pet-fs = { path = "../pet-fs" }
910
pet-python-utils = { path = "../pet-python-utils" }
1011
serde = {version = "1.0.226", features = ["derive"]}
1112
toml = "0.9.7"

0 commit comments

Comments
 (0)