Skip to content

Commit ed963b9

Browse files
committed
Remove xz entirely
Signed-off-by: William Woodruff <william@astral.sh> Update docs to reflect removal of xz Signed-off-by: William Woodruff <william@astral.sh> Undo boxcar change Signed-off-by: William Woodruff <william@astral.sh>
1 parent a38cfe0 commit ed963b9

9 files changed

Lines changed: 9 additions & 85 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ async-channel = { version = "2.3.1" }
100100
async-compression = { version = "0.4.12", features = [
101101
"bzip2",
102102
"gzip",
103-
"xz",
104103
"zstd",
105104
] }
106105
async-trait = { version = "0.1.82" }
@@ -301,7 +300,6 @@ windows-registry = { version = "0.5.0" }
301300
windows-version = { version = "0.1.6" }
302301
wiremock = { version = "0.6.4" }
303302
wmi = { version = "0.18.3", default-features = false }
304-
xz2 = { version = "0.1.7", features = ["static"] }
305303
zeroize = { version = "1.8.1" }
306304
zip = { version = "8.1.0", default-features = false, features = [
307305
"deflate",

crates/uv-bench/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,3 @@ tokio = { workspace = true }
4949

5050
[package.metadata.cargo-shear]
5151
ignored = ["uv-extract"]
52-
53-
[features]
54-
static = ["uv-extract/static"]

crates/uv-dev/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ name = "uv-dev"
7272
required-features = ["dev"]
7373

7474
[features]
75-
default = ["performance", "uv-extract/static"]
75+
default = ["performance"]
7676
# Actually build the dev CLI.
7777
dev = []
7878
performance = ["performance-memory-allocator"]

crates/uv-distribution/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ insta = { workspace = true }
6868

6969
[features]
7070
default = []
71-
static = ["uv-extract/static"]

crates/uv-extract/Cargo.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ uv-pypi-types = { workspace = true }
2222
uv-static = { workspace = true }
2323

2424
astral-tokio-tar = { workspace = true }
25-
async-compression = { workspace = true, features = ["bzip2", "gzip", "zstd", "xz"] }
25+
async-compression = { workspace = true, features = ["bzip2", "gzip", "zstd"] }
2626
async_zip = { workspace = true }
2727
blake2 = { workspace = true }
2828
fs-err = { workspace = true, features = ["tokio"] }
@@ -38,14 +38,8 @@ thiserror = { workspace = true }
3838
tokio = { workspace = true }
3939
tokio-util = { workspace = true, features = ["compat"] }
4040
tracing = { workspace = true }
41-
xz2 = { workspace = true }
4241
zip = { workspace = true }
4342
zstd = { workspace = true }
4443

4544
[features]
4645
default = []
47-
# Avoid a liblzma.so dependency
48-
static = ["xz2/static"]
49-
50-
[package.metadata.cargo-shear]
51-
ignored = ["xz2"]

crates/uv-extract/src/stream.rs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -769,30 +769,6 @@ pub fn untar_zst_file<R: std::io::Read>(
769769
Ok(files)
770770
}
771771

772-
/// Unpack a `.tar.xz` archive into the target directory, without requiring `Seek`.
773-
///
774-
/// This is useful for unpacking files as they're being downloaded.
775-
///
776-
/// Returns the list of unpacked files and their sizes.
777-
pub async fn untar_xz<R: tokio::io::AsyncRead + Unpin>(
778-
reader: R,
779-
target: impl AsRef<Path>,
780-
) -> Result<Vec<(PathBuf, u64)>, Error> {
781-
let reader = tokio::io::BufReader::with_capacity(DEFAULT_BUF_SIZE, reader);
782-
let mut decompressed_bytes = async_compression::tokio::bufread::XzDecoder::new(reader);
783-
784-
let archive = tokio_tar::ArchiveBuilder::new(
785-
&mut decompressed_bytes as &mut (dyn tokio::io::AsyncRead + Unpin),
786-
)
787-
.set_preserve_mtime(false)
788-
.set_preserve_permissions(false)
789-
.set_allow_external_symlinks(false)
790-
.build();
791-
untar_in(archive, target.as_ref())
792-
.await
793-
.map_err(Error::io_or_compression)
794-
}
795-
796772
/// Unpack a `.tar` archive into the target directory, without requiring `Seek`.
797773
///
798774
/// This is useful for unpacking files as they're being downloaded.
@@ -815,7 +791,7 @@ pub async fn untar<R: tokio::io::AsyncRead + Unpin>(
815791
.map_err(Error::io_or_compression)
816792
}
817793

818-
/// Unpack a `.zip`, `.tar.gz`, `.tar.bz2`, `.tar.zst`, or `.tar.xz` archive into the target directory,
794+
/// Unpack a `.zip`, `.tar.gz`, `.tar.bz2`, or `.tar.zst` archive into the target directory,
819795
/// without requiring `Seek`.
820796
///
821797
/// Returns the list of unpacked files and their sizes.
@@ -829,11 +805,7 @@ pub async fn archive<R: tokio::io::AsyncRead + Unpin>(
829805
SourceDistExtension::Tar => untar(reader, target).await,
830806
SourceDistExtension::Tgz | SourceDistExtension::TarGz => untar_gz(reader, target).await,
831807
SourceDistExtension::Tbz | SourceDistExtension::TarBz2 => untar_bz2(reader, target).await,
832-
SourceDistExtension::Txz
833-
| SourceDistExtension::TarXz
834-
| SourceDistExtension::Tlz
835-
| SourceDistExtension::TarLz
836-
| SourceDistExtension::TarLzma => untar_xz(reader, target).await,
837808
SourceDistExtension::TarZst => untar_zst(reader, target).await,
809+
_ => Err(Error::UnsupportedCompression),
838810
}
839811
}

crates/uv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ nix = { workspace = true }
160160
uv-unix = { workspace = true }
161161

162162
[features]
163-
default = ["performance", "uv-distribution/static", "test-defaults"]
163+
default = ["performance", "test-defaults"]
164164
native-auth = []
165165
# Use better memory allocators, etc.
166166
performance = ["performance-memory-allocator"]

docs/concepts/resolution.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -806,27 +806,13 @@ exclude-newer-package = { setuptools = "30 days" }
806806

807807
[PEP 625](https://peps.python.org/pep-0625/) specifies that packages must distribute source
808808
distributions as gzip tarball (`.tar.gz`) archives. Prior to this specification, other archive
809-
formats, which need to be supported for backward compatibility, were also allowed. uv supports
810-
reading and extracting archives in the following formats:
811-
812-
- gzip tarball (`.tar.gz`, `.tgz`)
813-
- bzip2 tarball (`.tar.bz2`, `.tbz`)
814-
- xz tarball (`.tar.xz`, `.txz`)
815-
- zstd tarball (`.tar.zst`)
816-
- lzip tarball (`.tar.lz`)
817-
- lzma tarball (`.tar.lzma`)
818-
- zip (`.zip`)
809+
formats, which need to be supported for backward compatibility, were also allowed.
819810

820811
!!! important
821812

822-
Using source distribution extensions other than `.tar.gz` is strongly
823-
discouraged, as these extensions are not widely or consistently
824-
supported across the Python packaging ecosystem.
825-
826-
!!! warning "Deprecated"
827-
828-
Support for source distribution extensions other than `.tar.gz` is
829-
deprecated and will be removed in a future release of uv.
813+
As of 0.12, uv rejects source distributions that do not confirm to
814+
[PEP 625]'s naming requirements with the exception of `.zip` archives,
815+
which are still accepted for backward compatibility.
830816

831817
## Lockfile versioning
832818

0 commit comments

Comments
 (0)