Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treat .tgz the same as .tar.gz #7201

Merged
merged 2 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/distribution-filename/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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,
}
2 changes: 1 addition & 1 deletion crates/uv/tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
Loading