Skip to content

Add .tar.zst support to unzip() - #20140

Merged
memsharded merged 2 commits into
conan-io:develop2from
perseoGI:pgi/tar.zst
Jul 8, 2026
Merged

Add .tar.zst support to unzip()#20140
memsharded merged 2 commits into
conan-io:develop2from
perseoGI:pgi/tar.zst

Conversation

@perseoGI

@perseoGI perseoGI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Changelog: Feature: Add .tar.zst (Zstandard) archive support to the unzip() tool function.
Docs: omit

When creating a recipe (currently private) for tensorrt, I found that Conan was not yet capable of unziping (from get() method) .tar.zst compressed files.

This PR simple redirects .tar.zst files to untargz Python's function, protecting it from Python <3.14 versions, same as we did in #19337.

Also, I've folded .tar.xz/.txz into the main tar-format check.
It used to live in its own if block only because it carried a Python 2 guard (#3197).
That guard was removed in #8397 when Python 2 support was dropped, but the block was never merged back.
No behavior change, just removing dead structure while touching this code for .tar.zst support

@memsharded memsharded added this to the 2.31.0 milestone Jul 8, 2026
@memsharded memsharded self-assigned this Jul 8, 2026
filename.endswith(".tar") or filename.endswith(".tar.xz") or
filename.endswith(".txz") or filename.endswith(".tar.zst")):
if filename.endswith(".tar.zst") and sys.version_info.minor < 14:
raise ConanException(f"File {os.path.basename(filename)} compressed with 'zst', "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, just be aware of using this for ConanCenter recipes, as it will trigger this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is right, we may need to upgrade to 3.14 eventually!

Comment thread conan/tools/files/files.py Outdated
@memsharded
memsharded merged commit e36a7f8 into conan-io:develop2 Jul 8, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants