From e669fce59285b2060fa94b5237a1fa61e635a8c1 Mon Sep 17 00:00:00 2001 From: Soof Golan Date: Mon, 9 Sep 2024 00:21:55 +0200 Subject: [PATCH 1/2] treat .tgz the same as .tar.gz --- crates/distribution-filename/src/extension.rs | 3 ++- crates/uv/tests/build.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/distribution-filename/src/extension.rs b/crates/distribution-filename/src/extension.rs index 5c06cff99417..0ede3f1aa6f3 100644 --- a/crates/distribution-filename/src/extension.rs +++ b/crates/distribution-filename/src/extension.rs @@ -70,6 +70,7 @@ impl SourceDistExtension { match extension { "zip" => Ok(Self::Zip), "gz" if is_tar(path.as_ref()) => Ok(Self::TarGz), + "tgz" => Ok(Self::TarGz), "bz2" if is_tar(path.as_ref()) => Ok(Self::TarBz2), "xz" if is_tar(path.as_ref()) => Ok(Self::TarXz), "zst" if is_tar(path.as_ref()) => Ok(Self::TarZst), @@ -94,6 +95,6 @@ impl Display for SourceDistExtension { pub enum ExtensionError { #[error("`.whl`, `.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, or `.tar.zst`")] Dist, - #[error("`.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, or `.tar.zst`")] + #[error("`.zip`, `.tar.gz`, `.tgz`, `.tar.bz2`, `.tar.xz`, or `.tar.zst`")] SourceDist, } diff --git a/crates/uv/tests/build.rs b/crates/uv/tests/build.rs index bc12234bedf0..dcaf5016313e 100644 --- a/crates/uv/tests/build.rs +++ b/crates/uv/tests/build.rs @@ -816,7 +816,7 @@ fn wheel_from_sdist() -> Result<()> { ----- stderr ----- Building wheel from source distribution... - error: `dist/project-0.1.0-py3-none-any.whl` is not a valid build source. Expected to receive a source directory, or a source distribution ending in one of: `.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, or `.tar.zst`. + error: `dist/project-0.1.0-py3-none-any.whl` is not a valid build source. Expected to receive a source directory, or a source distribution ending in one of: `.zip`, `.tar.gz`, `.tgz`, `.tar.bz2`, `.tar.xz`, or `.tar.zst`. "###); Ok(()) From 4254d7078ba26d9ae566e90738831a85a376b0fb Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 8 Sep 2024 19:03:04 -0400 Subject: [PATCH 2/2] Amend docs --- docs/concepts/resolution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/resolution.md b/docs/concepts/resolution.md index e5827b563644..8f3e4fd90254 100644 --- a/docs/concepts/resolution.md +++ b/docs/concepts/resolution.md @@ -303,7 +303,7 @@ archives. While less common, other formats are also supported when reading and e distributions: - bzip2 tarball (`.tar.bz2`) -- gzip tarball (`.tar.gz`) +- gzip tarball (`.tar.gz`, `.tgz`) - xz tarball (`.tar.xz`) - zip (`.zip`) - zstd tarball (`.tar.zst`)