@@ -31,15 +31,18 @@ def configure_parser(sub_parsers):
31
31
epilog += f" (aliased by { ', ' .join (p ['aliases' ])} )"
32
32
epilog += "\n "
33
33
highest_policy = get_policy_name (POLICY_PRIORITY_HIGHEST )
34
- help = "Vendor in external shared library dependencies of a wheel."
34
+ help = """Vendor in external shared library dependencies of a wheel.
35
+ If multiple wheels are specified, an error processing one
36
+ wheel will abort processing of subsequent wheels.
37
+ """
35
38
p = sub_parsers .add_parser (
36
39
"repair" ,
37
40
help = help ,
38
41
description = help ,
39
42
epilog = epilog ,
40
43
formatter_class = argparse .RawDescriptionHelpFormatter ,
41
44
)
42
- p .add_argument ("WHEEL_FILE" , help = "Path to wheel file." )
45
+ p .add_argument ("WHEEL_FILE" , help = "Path to wheel file." , nargs = "+" )
43
46
p .add_argument (
44
47
"--plat" ,
45
48
action = EnvironmentDefault ,
@@ -101,72 +104,73 @@ def execute(args, p):
101
104
from .repair import repair_wheel
102
105
from .wheel_abi import NonPlatformWheel , analyze_wheel_abi
103
106
104
- if not isfile (args .WHEEL_FILE ):
105
- p .error ("cannot access %s. No such file" % args .WHEEL_FILE )
107
+ for wheel_file in args .WHEEL_FILE :
108
+ if not isfile (wheel_file ):
109
+ p .error ("cannot access %s. No such file" % wheel_file )
106
110
107
- logger .info ("Repairing %s" , basename (args . WHEEL_FILE ))
111
+ logger .info ("Repairing %s" , basename (wheel_file ))
108
112
109
- if not exists (args .WHEEL_DIR ):
110
- os .makedirs (args .WHEEL_DIR )
113
+ if not exists (args .WHEEL_DIR ):
114
+ os .makedirs (args .WHEEL_DIR )
111
115
112
- try :
113
- wheel_abi = analyze_wheel_abi (args . WHEEL_FILE )
114
- except NonPlatformWheel :
115
- logger .info ("This does not look like a platform wheel" )
116
- return 1
116
+ try :
117
+ wheel_abi = analyze_wheel_abi (wheel_file )
118
+ except NonPlatformWheel :
119
+ logger .info ("This does not look like a platform wheel" )
120
+ return 1
117
121
118
- policy = get_policy_by_name (args .PLAT )
119
- reqd_tag = policy ["priority" ]
122
+ policy = get_policy_by_name (args .PLAT )
123
+ reqd_tag = policy ["priority" ]
120
124
121
- if reqd_tag > get_priority_by_name (wheel_abi .sym_tag ):
122
- msg = (
123
- 'cannot repair "%s" to "%s" ABI because of the presence '
124
- "of too-recent versioned symbols. You'll need to compile "
125
- "the wheel on an older toolchain." % (args . WHEEL_FILE , args .PLAT )
126
- )
127
- p .error (msg )
128
-
129
- if reqd_tag > get_priority_by_name (wheel_abi .ucs_tag ):
130
- msg = (
131
- 'cannot repair "%s" to "%s" ABI because it was compiled '
132
- "against a UCS2 build of Python. You'll need to compile "
133
- "the wheel against a wide-unicode build of Python."
134
- % (args . WHEEL_FILE , args .PLAT )
135
- )
136
- p .error (msg )
125
+ if reqd_tag > get_priority_by_name (wheel_abi .sym_tag ):
126
+ msg = (
127
+ 'cannot repair "%s" to "%s" ABI because of the presence '
128
+ "of too-recent versioned symbols. You'll need to compile "
129
+ "the wheel on an older toolchain." % (wheel_file , args .PLAT )
130
+ )
131
+ p .error (msg )
132
+
133
+ if reqd_tag > get_priority_by_name (wheel_abi .ucs_tag ):
134
+ msg = (
135
+ 'cannot repair "%s" to "%s" ABI because it was compiled '
136
+ "against a UCS2 build of Python. You'll need to compile "
137
+ "the wheel against a wide-unicode build of Python."
138
+ % (wheel_file , args .PLAT )
139
+ )
140
+ p .error (msg )
137
141
138
- if reqd_tag > get_priority_by_name (wheel_abi .blacklist_tag ):
139
- msg = (
140
- 'cannot repair "%s" to "%s" ABI because it depends on '
141
- "black-listed symbols." % (args .WHEEL_FILE , args .PLAT )
142
- )
143
- p .error (msg )
144
-
145
- abis = [policy ["name" ]] + policy ["aliases" ]
146
- if not args .ONLY_PLAT :
147
- if reqd_tag < get_priority_by_name (wheel_abi .overall_tag ):
148
- logger .info (
149
- (
150
- "Wheel is eligible for a higher priority tag. "
151
- "You requested %s but I have found this wheel is "
152
- "eligible for %s."
153
- ),
154
- args .PLAT ,
155
- wheel_abi .overall_tag ,
142
+ if reqd_tag > get_priority_by_name (wheel_abi .blacklist_tag ):
143
+ msg = (
144
+ 'cannot repair "%s" to "%s" ABI because it depends on '
145
+ "black-listed symbols." % (wheel_file , args .PLAT )
156
146
)
157
- higher_policy = get_policy_by_name (wheel_abi .overall_tag )
158
- abis = [higher_policy ["name" ]] + higher_policy ["aliases" ] + abis
159
-
160
- patcher = Patchelf ()
161
- out_wheel = repair_wheel (
162
- args .WHEEL_FILE ,
163
- abis = abis ,
164
- lib_sdir = args .LIB_SDIR ,
165
- out_dir = args .WHEEL_DIR ,
166
- update_tags = args .UPDATE_TAGS ,
167
- patcher = patcher ,
168
- strip = args .STRIP ,
169
- )
147
+ p .error (msg )
148
+
149
+ abis = [policy ["name" ]] + policy ["aliases" ]
150
+ if not args .ONLY_PLAT :
151
+ if reqd_tag < get_priority_by_name (wheel_abi .overall_tag ):
152
+ logger .info (
153
+ (
154
+ "Wheel is eligible for a higher priority tag. "
155
+ "You requested %s but I have found this wheel is "
156
+ "eligible for %s."
157
+ ),
158
+ args .PLAT ,
159
+ wheel_abi .overall_tag ,
160
+ )
161
+ higher_policy = get_policy_by_name (wheel_abi .overall_tag )
162
+ abis = [higher_policy ["name" ]] + higher_policy ["aliases" ] + abis
163
+
164
+ patcher = Patchelf ()
165
+ out_wheel = repair_wheel (
166
+ wheel_file ,
167
+ abis = abis ,
168
+ lib_sdir = args .LIB_SDIR ,
169
+ out_dir = args .WHEEL_DIR ,
170
+ update_tags = args .UPDATE_TAGS ,
171
+ patcher = patcher ,
172
+ strip = args .STRIP ,
173
+ )
170
174
171
- if out_wheel is not None :
172
- logger .info ("\n Fixed-up wheel written to %s" , out_wheel )
175
+ if out_wheel is not None :
176
+ logger .info ("\n Fixed-up wheel written to %s" , out_wheel )
0 commit comments