Skip to content

Commit bf65e93

Browse files
committed
dont repair non-win wheels
1 parent ddefd0a commit bf65e93

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,12 @@ def _download_and_extract(self, filename: str) -> pathlib.Path:
270270
if self.is_latest_nightly:
271271
if self.archive_format == "zip":
272272
zf = zipfile.ZipFile(fpath)
273-
folder = pathlib.Path(pathlib.Path(zf.namelist()[0]).stem)
273+
folder = pathlib.Path(pathlib.Path(zf.namelist()[0]).parts[0])
274274
else:
275275
tf = tarfile.open(fpath)
276-
folder = pathlib.Path(pathlib.Path(tf.getmembers()[0].name).stem)
276+
folder = pathlib.Path(pathlib.Path(tf.getmembers()[0].name).parts[0])
277277
else:
278-
folder = fpath.with_name(fpath.stem)
278+
folder = fpath.with_name(fpath.name.replace(self.archive_suffix, ""))
279279
# unless for ZIP, extract to current folder (all files inside an in-tar folder)
280280
extract_to = folder if self.archive_format == "zip" else self.base_dir
281281
shutil.unpack_archive(fpath, extract_to, self.archive_format)
@@ -347,6 +347,10 @@ def repair_windows_wheel(self, wheel: Path, dest_dir: Path):
347347
"""opens windows wheels in target folder and moves all DLLs files inside
348348
subdirectories of the wheel to the root one (where wrapper is expected)"""
349349

350+
# we're only interested in windows wheels
351+
if not re.match(r"libzim-.+-win_.+", wheel.stem):
352+
return
353+
350354
dest_wheel = dest_dir / wheel.name
351355
with InWheel(str(wheel), str(dest_wheel)) as wheel_dir_path:
352356
print(f"repairing {wheel.name} for Windows (DLLs next to wrapper)")

0 commit comments

Comments
 (0)