mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-16 01:35:00 +00:00
Use windows registry to discover python (#6761)
Our current strategy of parsing the output of `py --list-paths` to get the installed python versions on windows is brittle (#6524, missing `py`, etc.) and it's slow (10ms last time i measured). Instead, we should behave spec-compliant and read the python versions from the registry following PEP 514. It's not fully clear which errors we should ignore and which ones we need to raise. We're using the official rust-for-windows crates for accessing the registry. Fixes #1521 Fixes #6524
This commit is contained in:
parent
57cb9c2957
commit
a39eb61ade
10 changed files with 156 additions and 124 deletions
|
@ -29,6 +29,7 @@ pub mod managed;
|
|||
pub mod platform;
|
||||
mod pointer_size;
|
||||
mod prefix;
|
||||
#[cfg(windows)]
|
||||
mod py_launcher;
|
||||
mod python_version;
|
||||
mod target;
|
||||
|
@ -60,9 +61,6 @@ pub enum Error {
|
|||
#[error(transparent)]
|
||||
Discovery(#[from] discovery::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
PyLauncher(#[from] py_launcher::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
ManagedPython(#[from] managed::Error),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue