mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Add INSTALLER file to install-wheel-rs (#760)
See: https://packaging.python.org/en/latest/specifications/recording-installed-packages/#the-installer-file
This commit is contained in:
parent
c9f43e915c
commit
02b157085e
5 changed files with 16 additions and 0 deletions
|
@ -28,6 +28,7 @@ pub fn install_wheel(
|
|||
location: &InstallLocation<impl AsRef<Path>>,
|
||||
wheel: impl AsRef<Path>,
|
||||
direct_url: Option<&DirectUrl>,
|
||||
installer: Option<&str>,
|
||||
link_mode: LinkMode,
|
||||
) -> Result<(), Error> {
|
||||
let root = location.venv_root();
|
||||
|
@ -112,6 +113,7 @@ pub fn install_wheel(
|
|||
&dist_info_prefix,
|
||||
true,
|
||||
direct_url,
|
||||
installer,
|
||||
&mut record,
|
||||
)?;
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ fn main() -> Result<(), Error> {
|
|||
File::open(wheel)?,
|
||||
&filename,
|
||||
None,
|
||||
None,
|
||||
args.compile,
|
||||
!args.skip_hashes,
|
||||
&[],
|
||||
|
|
|
@ -63,6 +63,7 @@ impl LockedVenv {
|
|||
File::open(wheel)?,
|
||||
&filename,
|
||||
None,
|
||||
None,
|
||||
true,
|
||||
true,
|
||||
&[],
|
||||
|
|
|
@ -819,6 +819,7 @@ pub(crate) fn extra_dist_info(
|
|||
dist_info_prefix: &str,
|
||||
requested: bool,
|
||||
direct_url: Option<&DirectUrl>,
|
||||
installer: Option<&str>,
|
||||
record: &mut Vec<RecordEntry>,
|
||||
) -> Result<(), Error> {
|
||||
let dist_info_dir = PathBuf::from(format!("{dist_info_prefix}.dist-info"));
|
||||
|
@ -839,6 +840,14 @@ pub(crate) fn extra_dist_info(
|
|||
record,
|
||||
)?;
|
||||
}
|
||||
if let Some(installer) = installer {
|
||||
write_file_recorded(
|
||||
site_packages,
|
||||
&dist_info_dir.join("INSTALLER"),
|
||||
installer,
|
||||
record,
|
||||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -900,6 +909,7 @@ pub fn install_wheel(
|
|||
reader: impl Read + Seek,
|
||||
filename: &WheelFilename,
|
||||
direct_url: Option<&DirectUrl>,
|
||||
installer: Option<&str>,
|
||||
compile: bool,
|
||||
check_hashes: bool,
|
||||
// initially used to the console scripts, currently unused. Keeping it because we likely need
|
||||
|
@ -1022,6 +1032,7 @@ pub fn install_wheel(
|
|||
&dist_info_prefix,
|
||||
true,
|
||||
direct_url,
|
||||
installer,
|
||||
&mut record,
|
||||
)?;
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ impl<'a> Installer<'a> {
|
|||
.map(pypi_types::DirectUrl::try_from)
|
||||
.transpose()?
|
||||
.as_ref(),
|
||||
Some("puffin"),
|
||||
self.link_mode,
|
||||
)
|
||||
.with_context(|| format!("Failed to install: {} ({wheel})", wheel.filename()))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue