uv/crates/install-wheel-rs
Charlie Marsh 26045e5f59
Respect and enable uninstalls of existing .egg-info packages (#3380)
## Summary

Users often find themselves dropped into environments that contain
`.egg-info` packages. While we won't support installing these, it's not
hard to support identifying them (e.g., in `pip freeze`) and
_uninstalling_ them.

Closes https://github.com/astral-sh/uv/issues/2841.
Closes #2928.
Closes #3341.

## Test Plan

Ran `cargo run pip freeze --python
/opt/homebrew/Caskroom/miniforge/base/envs/TEST/bin/python`, with an
environment that includes `pip` as an `.egg-info`
(`/opt/homebrew/Caskroom/miniforge/base/envs/TEST/lib/python3.12/site-packages/pip-24.0-py3.12.egg-info`):

```
cffi @ file:///Users/runner/miniforge3/conda-bld/cffi_1696001825047/work
pip==24.0
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1711811537435/work
setuptools==69.5.1
wheel==0.43.0
```

Then ran `cargo run pip uninstall`, verified that `pip` was uninstalled,
and no longer listed in `pip freeze`.
2024-05-06 09:47:28 -04:00
..
src Respect and enable uninstalls of existing .egg-info packages (#3380) 2024-05-06 09:47:28 -04:00
Cargo.toml Add JSON Schema support (#3046) 2024-04-17 17:24:41 +00:00
Readme.md Copy over install-wheel-rs crate (#33) 2023-10-06 21:38:38 -04:00

Reimplementation of wheel installing in rust. Supports both classical venvs and monotrail.

There are simple python bindings:

from install_wheel_rs import LockedVenv

locked_venv = LockedVenv("path/to/.venv")
locked_venv.install_wheel("path/to/some_tagged_wheel.whl")

and there's only one function: install_wheels_venv(wheels: List[str], venv: str), where wheels is a list of paths to wheel files and venv is the location of the venv to install the packages in.

See monotrail for benchmarks.