mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-15 08:10:15 +00:00
Respect data scripts in uv tool install
(#4693)
## 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)
This commit is contained in:
parent
081f092781
commit
324e9fe5cf
9 changed files with 89 additions and 80 deletions
|
@ -9,10 +9,10 @@ use crate::{wheel, Error};
|
|||
/// A script defining the name of the runnable entrypoint and the module and function that should be
|
||||
/// run.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
|
||||
pub struct Script {
|
||||
pub name: String,
|
||||
pub module: String,
|
||||
pub function: String,
|
||||
pub(crate) struct Script {
|
||||
pub(crate) name: String,
|
||||
pub(crate) module: String,
|
||||
pub(crate) function: String,
|
||||
}
|
||||
|
||||
impl Script {
|
||||
|
@ -64,7 +64,7 @@ impl Script {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn scripts_from_ini(
|
||||
pub(crate) fn scripts_from_ini(
|
||||
extras: Option<&[String]>,
|
||||
python_minor: u8,
|
||||
ini: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue