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

Test against unzip_jll #36

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
ZipArchives = "49080126-0e18-4c2a-b176-c102e4b3760c"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
p7zip_jll = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
unzip_jll = "88f77b66-78eb-5ed0-bc16-ebba0796830d"
15 changes: 15 additions & 0 deletions test/external_unzippers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ZipFile
import p7zip_jll
import LibArchive_jll
import unzip_jll
# ENV["JULIA_CONDAPKG_BACKEND"] = "Null"
try
import PythonCall
Expand Down Expand Up @@ -34,6 +35,19 @@ function unzip_bsdtar(zippath, dirpath)
nothing
end

"""
Extract the zip file at zippath into the directory dirpath
Use unzip from unzip_jll
"""
function unzip_unzip_jll(zippath, dirpath)
try
run(`$(unzip_jll.unzip()) $(zippath) -d $(dirpath)`)
catch
# unzip errors if the zip file is empty for some reason
end
nothing
end

function have_python()
isdefined(@__MODULE__, :PythonCall)
end
Expand Down Expand Up @@ -80,6 +94,7 @@ end
unzippers = Any[
unzip_p7zip,
unzip_bsdtar,
unzip_unzip_jll,
]

if have_python()
Expand Down