@@ -4,7 +4,6 @@ use std::str::FromStr;
44
55use bzip2:: read:: BzDecoder ;
66use flate2:: read:: GzDecoder ;
7- use xz:: read:: XzDecoder ;
87use zip:: ZipArchive ;
98
109use crate :: { Error , Metadata } ;
@@ -23,10 +22,8 @@ pub enum DistributionType {
2322#[ derive( Debug , Clone , Copy ) ]
2423enum SDistType {
2524 Zip ,
26- Tar ,
2725 GzTar ,
2826 BzTar ,
29- XzTar ,
3027}
3128
3229/// Python package distribution
@@ -42,10 +39,8 @@ impl FromStr for SDistType {
4239 fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
4340 let dist_type = match s {
4441 "zip" => SDistType :: Zip ,
45- "tar" => SDistType :: Tar ,
4642 "gz" => SDistType :: GzTar ,
4743 "bz2" => SDistType :: BzTar ,
48- "xz" => SDistType :: XzTar ,
4944 _ => return Err ( Error :: UnknownDistributionType ) ,
5045 } ;
5146 Ok ( dist_type)
@@ -58,7 +53,7 @@ impl Distribution {
5853 let path = path. as_ref ( ) ;
5954 if let Some ( ext) = path. extension ( ) . and_then ( |ext| ext. to_str ( ) ) {
6055 let dist_type = match ext {
61- "zip" | "tar" | " gz" | "bz2" | "xz " => DistributionType :: SDist ,
56+ "zip" | "gz" | "bz2" => DistributionType :: SDist ,
6257 "egg" => DistributionType :: Egg ,
6358 "whl" => DistributionType :: Wheel ,
6459 _ => return Err ( Error :: UnknownDistributionType ) ,
@@ -95,13 +90,9 @@ impl Distribution {
9590 SDistType :: GzTar => {
9691 Self :: parse_tar ( GzDecoder :: new ( BufReader :: new ( fs_err:: File :: open ( path) ?) ) )
9792 }
98- SDistType :: Tar => Self :: parse_tar ( BufReader :: new ( fs_err:: File :: open ( path) ?) ) ,
9993 SDistType :: BzTar => {
10094 Self :: parse_tar ( BzDecoder :: new ( BufReader :: new ( fs_err:: File :: open ( path) ?) ) )
10195 }
102- SDistType :: XzTar => {
103- Self :: parse_tar ( XzDecoder :: new ( BufReader :: new ( fs_err:: File :: open ( path) ?) ) )
104- }
10596 }
10697 }
10798
0 commit comments