mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-02 04:48:18 +00:00
Add source distribution filename abstraction (#154)
The need for this became clear when working on the source distribution integration into the resolver. While at it i also switch the `WheelFilename` version to the parsed `pep440_rs` version now that we have this crate.
This commit is contained in:
parent
6f52b5ca4d
commit
ae9d1f7572
19 changed files with 220 additions and 58 deletions
|
|
@ -18,7 +18,7 @@ name = "install_wheel_rs"
|
|||
|
||||
[dependencies]
|
||||
platform-host = { path = "../platform-host" }
|
||||
wheel-filename = { path = "../wheel-filename" }
|
||||
distribution-filename = { path = "../distribution-filename" }
|
||||
|
||||
clap = { workspace = true, optional = true, features = ["derive", "env"] }
|
||||
configparser = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ pub enum Error {
|
|||
InvalidPoetry(String),
|
||||
/// Doesn't follow file name schema
|
||||
#[error(transparent)]
|
||||
InvalidWheelFileName(#[from] wheel_filename::Error),
|
||||
InvalidWheelFileName(#[from] distribution_filename::WheelFilenameError),
|
||||
#[error("Failed to read the wheel file {0}")]
|
||||
Zip(String, #[source] ZipError),
|
||||
#[error("Failed to run python subcommand")]
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use fs_err::File;
|
|||
#[cfg(feature = "rayon")]
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
|
||||
use distribution_filename::WheelFilename;
|
||||
use install_wheel_rs::{install_wheel, Error, InstallLocation};
|
||||
use wheel_filename::WheelFilename;
|
||||
|
||||
/// Low level install CLI, mainly used for testing
|
||||
#[derive(Parser)]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#![allow(clippy::format_push_string)] // I will not replace clear and infallible with fallible, io looking code
|
||||
|
||||
use crate::{install_wheel, Error, InstallLocation, LockedDir};
|
||||
use distribution_filename::WheelFilename;
|
||||
use fs_err::File;
|
||||
use pyo3::create_exception;
|
||||
use pyo3::types::PyModule;
|
||||
|
|
@ -8,7 +9,6 @@ use pyo3::{pyclass, pymethods, pymodule, PyErr, PyResult, Python};
|
|||
use std::env;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
use wheel_filename::WheelFilename;
|
||||
|
||||
create_exception!(
|
||||
install_wheel_rs,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use zip::result::ZipError;
|
|||
use zip::write::FileOptions;
|
||||
use zip::{ZipArchive, ZipWriter};
|
||||
|
||||
use wheel_filename::WheelFilename;
|
||||
use distribution_filename::WheelFilename;
|
||||
|
||||
use crate::install_location::{InstallLocation, LockedDir};
|
||||
use crate::record::RecordEntry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue