mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-18 19:21:46 +00:00
## Summary Packages that provide scripts that _aren't_ Python entrypoints need to respected in `uv tool install`. For example, Ruff ships a script in `ruff-0.5.0.data/scripts`. Unfortunately, the `.data` directory doesn't exist in the virtual environment at all (it's removed, per the spec, after install). So this PR changes the entry point detection to look at the `RECORD` file, which is the only evidence that the scripts were installed. Closes https://github.com/astral-sh/uv/issues/4691. ## Test Plan `cargo run uv tool install ruff` (snapshot tests to-come)
16 lines
446 B
Rust
16 lines
446 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
/// Line in a RECORD file
|
|
/// <https://www.python.org/dev/peps/pep-0376/#record>
|
|
///
|
|
/// ```csv
|
|
/// tqdm/cli.py,sha256=x_c8nmc4Huc-lKEsAXj78ZiyqSJ9hJ71j7vltY67icw,10509
|
|
/// tqdm-4.62.3.dist-info/RECORD,,
|
|
/// ```
|
|
#[derive(Deserialize, Serialize, PartialOrd, PartialEq, Ord, Eq)]
|
|
pub struct RecordEntry {
|
|
pub path: String,
|
|
pub hash: Option<String>,
|
|
#[allow(dead_code)]
|
|
pub size: Option<u64>,
|
|
}
|