8
8
from collections import OrderedDict
9
9
from os .path import exists , basename , abspath , isabs , dirname
10
10
from os .path import join as pjoin
11
- from typing import Dict , Optional
11
+ from typing import Dict , Optional , Tuple
12
12
13
13
from auditwheel .patcher import ElfPatcher
14
14
from .elfutils import elf_read_rpaths , elf_read_dt_needed , is_subdir
@@ -34,9 +34,9 @@ def repair_wheel(wheel_path: str, abi: str, lib_sdir: str, out_dir: str,
34
34
35
35
# Do not repair a pure wheel, i.e. has no external refs
36
36
if not external_refs_by_fn :
37
- return
37
+ return None
38
38
39
- soname_map = {} # type: Dict[str, str]
39
+ soname_map = {} # type: Dict[str, Tuple[ str, str] ]
40
40
if not isabs (out_dir ):
41
41
out_dir = abspath (out_dir )
42
42
@@ -45,7 +45,12 @@ def repair_wheel(wheel_path: str, abi: str, lib_sdir: str, out_dir: str,
45
45
with InWheelCtx (wheel_path ) as ctx :
46
46
ctx .out_wheel = pjoin (out_dir , wheel_fname )
47
47
48
- dest_dir = WHEEL_INFO_RE (wheel_fname ).group ('name' ) + lib_sdir
48
+ match = WHEEL_INFO_RE (wheel_fname )
49
+ if not match :
50
+ raise ValueError ("Failed to parse wheel file name: %s" ,
51
+ wheel_fname )
52
+
53
+ dest_dir = match .group ('name' ) + lib_sdir
49
54
50
55
if not exists (dest_dir ):
51
56
os .mkdir (dest_dir )
0 commit comments