Skip to content

Commit 82fc865

Browse files
committed
ENH: Limit glob patters for whl fixing on linux and manylinux
1 parent e13fabd commit 82fc865

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎scripts/linux_build_python_instance.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ def post_build_fixup(self) -> None:
7575
if manylinux_ver:
7676
# Repair all produced wheels with auditwheel for packages with so elements (starts with itk_)
7777
whl = None
78-
for whl in (self.build_dir_root / "dist").glob("itk_*linux_*.whl"):
78+
# cp39-cp39-linux itk_segmentation-6.0.0b2-cp39-cp39-linux_x86_64.whl
79+
cp_prefix: str = self.platform_env.replace("py", "cp").replace(".", "")
80+
binary_wheel_glob_pattern: str = "itk_*-*{cp_prefix}*-linux_*.whl"
81+
dist_path: Path = self.build_dir_root / "dist"
82+
for whl in dist_path.glob(binary_wheel_glob_pattern):
7983
if str(whl).startswith("itk-"):
8084
print(
8185
f"Skipping the itk-meta wheel that has nothing to fixup {whl}"
@@ -86,9 +90,8 @@ def post_build_fixup(self) -> None:
8690
# Retag meta-wheel: Special handling for the itk meta wheel to adjust tag
8791
# auditwheel does not process this "metawheel" correctly since it does not
8892
# have any native SO's.
89-
for metawhl in list(
90-
(self.build_dir_root / "dist").glob("itk-*linux_*.whl")
91-
):
93+
meta_wheel_glob_pattern: str = "itk-*-*{cp_prefix}*-linux_*.whl"
94+
for metawhl in dist_path.glob(meta_wheel_glob_pattern):
9295
# Unpack, edit WHEEL tag, repack
9396
metawheel_dir = self.build_dir_root / "metawheel"
9497
metawheel_dir.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)