Skip to content

Commit a3d5440

Browse files
committed
Stabilize addition to the Windows registry
1 parent bd853de commit a3d5440

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

crates/uv/src/commands/python/install.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,9 @@ pub(crate) async fn install(
485485
preview,
486486
)?;
487487

488-
if preview.is_enabled() {
489-
#[cfg(windows)]
490-
{
491-
uv_python::windows_registry::create_registry_entry(installation, &mut errors)?;
492-
}
488+
#[cfg(windows)]
489+
{
490+
uv_python::windows_registry::create_registry_entry(installation, &mut errors)?;
493491
}
494492
}
495493

crates/uv/src/commands/python/uninstall.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ async fn do_uninstall(
211211
}
212212

213213
#[cfg(windows)]
214-
if preview.is_enabled() {
214+
{
215215
uv_python::windows_registry::remove_registry_entry(
216216
&matching_installations,
217217
all,

docs/concepts/python-versions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,18 @@ are not yet available for musl Linux on ARM).
435435
### PyPy distributions
436436

437437
PyPy distributions are provided by the PyPy project.
438+
439+
## Registration in the Windows registry
440+
441+
On Windows, installation of managed Python versions will register them with the Windows registry as
442+
defined by [PEP 514](https://peps.python.org/pep-0514/).
443+
444+
After installation, the Python versions can be selected with the `py` launcher, e.g.:
445+
446+
```console
447+
$ uv python install 3.13.1
448+
$ py -V:Astral/CPython3.13.1
449+
```
450+
451+
On uninstall, uv will remove the registry entry for the target version as well as any broken
452+
registry entries.

0 commit comments

Comments
 (0)