@@ -330,27 +330,33 @@ def test_repair_exclude(self, any_manylinux_container, io_folder):
330
330
assert "manylinux" not in orig_wheel
331
331
332
332
def run_repair_test (exclude_args , expected_exclusions ):
333
- repair_command = [
334
- f"LD_LIBRARY_PATH={ test_path } /a:$LD_LIBRARY_PATH" ,
335
- "auditwheel" ,
336
- "repair" ,
337
- f"--plat={ policy } " ,
338
- "--only-plat" ,
339
- "-w" ,
340
- "/io" ,
341
- ] + exclude_args + [
342
- f"/io/{ orig_wheel } " ,
343
- ]
344
- output = docker_exec (manylinux_ctr , ["bash" , "-c" , " " .join (repair_command )])
333
+ repair_command = (
334
+ [
335
+ f"LD_LIBRARY_PATH={ test_path } /a:$LD_LIBRARY_PATH" ,
336
+ "auditwheel" ,
337
+ "repair" ,
338
+ f"--plat={ policy } " ,
339
+ "--only-plat" ,
340
+ "-w" ,
341
+ "/io" ,
342
+ ]
343
+ + exclude_args
344
+ + [
345
+ f"/io/{ orig_wheel } " ,
346
+ ]
347
+ )
348
+ output = docker_exec (
349
+ manylinux_ctr , ["bash" , "-c" , " " .join (repair_command )]
350
+ )
345
351
346
352
# Check for exclusions in the output
347
353
for arg in exclude_args :
348
- if ',' in arg :
349
- libs = arg .split ('=' )[1 ].split (',' )
354
+ if "," in arg :
355
+ libs = arg .split ("=" )[1 ].split ("," )
350
356
for lib in libs :
351
357
assert f"Excluding { lib } " in output
352
358
else :
353
- lib = arg .split ('=' )[1 ]
359
+ lib = arg .split ("=" )[1 ]
354
360
assert f"Excluding { lib } " in output
355
361
356
362
filenames = os .listdir (io_folder )
@@ -359,14 +365,21 @@ def run_repair_test(exclude_args, expected_exclusions):
359
365
assert repaired_wheel in filenames
360
366
361
367
# Make sure we don't have the excluded libraries in the result
362
- contents = zipfile .ZipFile (os .path .join (io_folder , repaired_wheel )).namelist ()
368
+ contents = zipfile .ZipFile (
369
+ os .path .join (io_folder , repaired_wheel )
370
+ ).namelist ()
363
371
for lib in expected_exclusions :
364
372
assert not any (x for x in contents if f"/{ lib } " in x )
365
373
366
- # Test case 1: Exclude liba.so only - it will exclude libb.so as well due to indirect reference
367
- run_repair_test (["--exclude=liba.so" , "--exclude=libx.so" ], ["liba.so" , "libb.so" , "libx.so" ])
374
+ # Test case 1: Exclude liba.so and libx.so using 2 --exclude parameters
375
+ run_repair_test (
376
+ ["--exclude=liba.so" , "--exclude=libx.so" ],
377
+ ["liba.so" , "libb.so" , "libx.so" ],
378
+ )
368
379
# Test case 2: Exclude liba.so and libx.so using comma separated
369
- run_repair_test (["--exclude=liba.so,libx.so" ], ["liba.so" , "libb.so" , "libx.so" ])
380
+ run_repair_test (
381
+ ["--exclude=liba.so,libx.so" ], ["liba.so" , "libb.so" , "libx.so" ]
382
+ )
370
383
371
384
def test_build_wheel_with_binary_executable (
372
385
self , any_manylinux_container , docker_python , io_folder
0 commit comments