Move DirectUrl into pypi-types (#343)

This needs to be reused elsewhere, and there's nothing specific to wheel
installation about it.
This commit is contained in:
Charlie Marsh 2023-11-06 10:26:33 -08:00 committed by GitHub
parent 24e30e6557
commit b013ea9c93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 6 deletions

1
Cargo.lock generated
View file

@ -1445,6 +1445,7 @@ dependencies = [
"platform-info", "platform-info",
"plist", "plist",
"pyo3", "pyo3",
"pypi-types",
"rayon", "rayon",
"reflink-copy", "reflink-copy",
"regex", "regex",

View file

@ -17,8 +17,9 @@ license = { workspace = true }
name = "install_wheel_rs" name = "install_wheel_rs"
[dependencies] [dependencies]
platform-host = { path = "../platform-host" }
distribution-filename = { path = "../distribution-filename" } distribution-filename = { path = "../distribution-filename" }
platform-host = { path = "../platform-host" }
pypi-types = { path = "../pypi-types" }
clap = { workspace = true, optional = true, features = ["derive", "env"] } clap = { workspace = true, optional = true, features = ["derive", "env"] }
configparser = { workspace = true } configparser = { workspace = true }

View file

@ -7,7 +7,6 @@ use platform_info::PlatformInfoError;
use thiserror::Error; use thiserror::Error;
use zip::result::ZipError; use zip::result::ZipError;
pub use direct_url::DirectUrl;
pub use install_location::{normalize_name, InstallLocation, LockedDir}; pub use install_location::{normalize_name, InstallLocation, LockedDir};
use platform_host::{Arch, Os}; use platform_host::{Arch, Os};
pub use record::RecordEntry; pub use record::RecordEntry;
@ -18,7 +17,6 @@ pub use wheel::{
relative_to, SHEBANG_PYTHON, relative_to, SHEBANG_PYTHON,
}; };
mod direct_url;
mod install_location; mod install_location;
pub mod linker; pub mod linker;
#[cfg(feature = "python_bindings")] #[cfg(feature = "python_bindings")]

View file

@ -10,12 +10,14 @@ use fs_err::File;
use mailparse::MailHeaderMap; use mailparse::MailHeaderMap;
use tracing::{debug, span, Level}; use tracing::{debug, span, Level};
use pypi_types::DirectUrl;
use crate::install_location::InstallLocation; use crate::install_location::InstallLocation;
use crate::wheel::{ use crate::wheel::{
extra_dist_info, install_data, parse_wheel_version, read_scripts_from_section, extra_dist_info, install_data, parse_wheel_version, read_scripts_from_section,
write_script_entrypoints, write_script_entrypoints,
}; };
use crate::{read_record_file, DirectUrl, Error, Script}; use crate::{read_record_file, Error, Script};
/// Install the given wheel to the given venv /// Install the given wheel to the given venv
/// ///

View file

@ -14,18 +14,18 @@ use mailparse::MailHeaderMap;
use sha2::{Digest, Sha256}; use sha2::{Digest, Sha256};
use tempfile::tempdir; use tempfile::tempdir;
use tracing::{debug, error, span, warn, Level}; use tracing::{debug, error, span, warn, Level};
use walkdir::WalkDir; use walkdir::WalkDir;
use zip::result::ZipError; use zip::result::ZipError;
use zip::write::FileOptions; use zip::write::FileOptions;
use zip::{ZipArchive, ZipWriter}; use zip::{ZipArchive, ZipWriter};
use distribution_filename::WheelFilename; use distribution_filename::WheelFilename;
use pypi_types::DirectUrl;
use crate::install_location::{InstallLocation, LockedDir}; use crate::install_location::{InstallLocation, LockedDir};
use crate::record::RecordEntry; use crate::record::RecordEntry;
use crate::script::Script; use crate::script::Script;
use crate::{DirectUrl, Error}; use crate::Error;
/// `#!/usr/bin/env python` /// `#!/usr/bin/env python`
pub const SHEBANG_PYTHON: &str = "#!/usr/bin/env python"; pub const SHEBANG_PYTHON: &str = "#!/usr/bin/env python";

View file

@ -1,5 +1,7 @@
pub use direct_url::DirectUrl;
pub use metadata::{Error, Metadata21}; pub use metadata::{Error, Metadata21};
pub use simple_json::{File, SimpleJson}; pub use simple_json::{File, SimpleJson};
mod direct_url;
mod metadata; mod metadata;
mod simple_json; mod simple_json;