Struct python_packaging::wheel::WheelArchive
source · pub struct WheelArchive { /* private fields */ }
Expand description
Represents a Python wheel archive.
Implementations
sourceimpl WheelArchive
impl WheelArchive
sourcepub fn from_reader<R>(reader: R, basename: &str) -> Result<Self>where
R: Read + Seek,
pub fn from_reader<R>(reader: R, basename: &str) -> Result<Self>where
R: Read + Seek,
Construct an instance from a generic reader.
basename
is the filename of the wheel. It is used to try to
locate the info directory.
sourcepub fn archive_metadata(&self) -> Result<PythonPackageMetadata>
pub fn archive_metadata(&self) -> Result<PythonPackageMetadata>
Obtain metadata about the wheel archive itself.
sourcepub fn metadata(&self) -> Result<PythonPackageMetadata>
pub fn metadata(&self) -> Result<PythonPackageMetadata>
Obtain the .dist-info/METADATA
content as a parsed object.
sourcepub fn archive_metadata_header(&self, header: &str) -> Result<Cow<'_, str>>
pub fn archive_metadata_header(&self, header: &str) -> Result<Cow<'_, str>>
Obtain the first header value from the archive metadata file.
sourcepub fn archive_metadata_headers(&self, header: &str) -> Result<Vec<Cow<'_, str>>>
pub fn archive_metadata_headers(&self, header: &str) -> Result<Vec<Cow<'_, str>>>
Obtain values of all headers from the archive metadata file.
sourcepub fn wheel_version(&self) -> Result<Cow<'_, str>>
pub fn wheel_version(&self) -> Result<Cow<'_, str>>
Obtain the version number of the wheel specification used to build this wheel.
sourcepub fn wheel_generator(&self) -> Result<Cow<'_, str>>
pub fn wheel_generator(&self) -> Result<Cow<'_, str>>
Obtain the generator of the wheel archive.
sourcepub fn root_is_purelib(&self) -> Result<bool>
pub fn root_is_purelib(&self) -> Result<bool>
Whether Root-Is-Purelib
is set.
Tag
values for the wheel archive.
sourcepub fn dist_info_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn dist_info_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain files in the .dist-info/ directory.
The returned PathBuf
are prefixed with the appropriate *.dist-info
directory.
sourcepub fn purelib_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn purelib_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain files that should be installed to purelib
.
*.data/purelib/
prefix is stripped from returned PathBuf
.
sourcepub fn platlib_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn platlib_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain files that should be installed to platlib
.
*.data/platlib/
prefix is stripped from returned PathBuf
.
sourcepub fn headers_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn headers_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain files that should be installed to headers
.
*.data/headers/
prefix is stripped from returned PathBuf
.
sourcepub fn scripts_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn scripts_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain files that should be installed to scripts
.
*.data/scripts/
prefix is stripped from returned PathBuf
.
TODO support optional argument to rewrite #!python
shebangs.
sourcepub fn data_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn data_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain files that should be installed to data
.
*.data/data/
prefix is stripped from returned PathBuf
.
sourcepub fn regular_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn regular_files(&self) -> Vec<File>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Obtain normal files not part of metadata or special files.
These are likely installed as-is.
The returned PathBuf
has the same path as the file in the
wheel archive.
sourcepub fn python_resources<'a>(
&self,
cache_tag: &str,
suffixes: &PythonModuleSuffixes,
emit_files: bool,
classify_files: bool
) -> Result<Vec<PythonResource<'a>>>
pub fn python_resources<'a>(
&self,
cache_tag: &str,
suffixes: &PythonModuleSuffixes,
emit_files: bool,
classify_files: bool
) -> Result<Vec<PythonResource<'a>>>
Obtain PythonResource
for files within the wheel.