Skip to content

Commit da55f70

Browse files
committed
ZIP needs a target folder and include folder needs to exist
1 parent 96e4094 commit da55f70

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,6 @@ def _download_and_extract(self, filename: str) -> pathlib.Path:
244244
print(f"> reusing local file {fpath}")
245245

246246
print("> extracting archive")
247-
# extract into current folder (all files are inside an in-tar folder)
248-
shutil.unpack_archive(fpath, self.base_dir, self.archive_format)
249247

250248
# nightly have different download name and extracted folder name as it
251249
# uses a redirect
@@ -255,6 +253,9 @@ def _download_and_extract(self, filename: str) -> pathlib.Path:
255253
folder = pathlib.Path(pathlib.Path(tar.firstmember.name).parts[0])
256254
else:
257255
folder = fpath.with_name(fpath.name.replace(self.archive_suffix, ""))
256+
# unless for ZIP, extract to current folder (all files inside an in-tar folder)
257+
extract_to = folder if self.archive_format == "zip" else self.base_dir
258+
shutil.unpack_archive(fpath, extract_to, self.archive_format)
258259

259260
return folder
260261

@@ -267,6 +268,7 @@ def _install_from(self, folder: pathlib.Path):
267268
shutil.rmtree(self.base_dir / "include" / "zim", ignore_errors=True)
268269

269270
# copy new zim headers
271+
(self.base_dir / "include").mkdir(exist_ok=True, parents=True)
270272
shutil.move(folder / "include" / "zim", self.base_dir / "include" / "zim")
271273

272274
# copy new libs

0 commit comments

Comments
 (0)