@@ -313,51 +313,45 @@ def test_build_repair_numpy(
313313 # at once in the same Python program:
314314 docker_exec (docker_python , ["python" , "-c" , "'import numpy; import foo'" ])
315315
316- @pytest .mark .skipif (
317- PLATFORM != "x86_64" , reason = "Only needs checking on one platform"
318- )
319316 def test_repair_exclude (self , any_manylinux_container , io_folder ):
320317 """Test the --exclude argument to avoid grafting certain libraries."""
321318
322319 policy , tag , manylinux_ctr = any_manylinux_container
323320
324- orig_wheel = build_numpy (manylinux_ctr , policy , io_folder )
325- assert orig_wheel == ORIGINAL_NUMPY_WHEEL
321+ test_path = "/auditwheel_src/tests/integration/testrpath"
322+ build_cmd = (
323+ f"cd { test_path } && "
324+ "if [ -d ./build ]; then rm -rf ./build ./*.egg-info; fi && "
325+ "python setup.py bdist_wheel -d /io"
326+ )
327+ docker_exec (manylinux_ctr , ["bash" , "-c" , build_cmd ])
328+ filenames = os .listdir (io_folder )
329+ assert filenames == [f"testrpath-0.0.1-{ PYTHON_ABI } -linux_{ PLATFORM } .whl" ]
330+ orig_wheel = filenames [0 ]
326331 assert "manylinux" not in orig_wheel
327332
328- # Exclude libgfortran from grafting into the wheel
329- excludes = {
330- "manylinux_2_5_x86_64" : ["libgfortran.so.1" , "libgfortran.so.3" ],
331- "manylinux_2_12_x86_64" : ["libgfortran.so.3" , "libgfortran.so.5" ],
332- "manylinux_2_17_x86_64" : ["libgfortran.so.3" , "libgfortran.so.5" ],
333- "manylinux_2_28_x86_64" : ["libgfortran.so.5" ],
334- "musllinux_1_1_x86_64" : ["libgfortran.so.5" ],
335- }[policy ]
336-
337333 repair_command = [
334+ "env" ,
335+ f"LD_LIBRARY_PATH={ test_path } /a:$LD_LIBRARY_PATH" ,
338336 "auditwheel" ,
339337 "repair" ,
340- "--plat" ,
341- policy ,
338+ f"--plat={ policy } " ,
342339 "--only-plat" ,
343340 "-w" ,
344341 "/io" ,
342+ "--exclude=liba.so" ,
343+ f"/io/{ orig_wheel } " ,
345344 ]
346- for exclude in excludes :
347- repair_command .extend (["--exclude" , exclude ])
348- repair_command .append (f"/io/{ orig_wheel } " )
349345 output = docker_exec (manylinux_ctr , repair_command )
350-
351- for exclude in excludes :
352- assert f"Excluding { exclude } " in output
346+ assert "Excluding liba.so" in output
353347 filenames = os .listdir (io_folder )
354348 assert len (filenames ) == 2
355- repaired_wheel = f"numpy- { NUMPY_VERSION } -{ PYTHON_ABI } -{ tag } .whl"
349+ repaired_wheel = f"testrpath-0.0.1 -{ PYTHON_ABI } -{ tag } .whl"
356350 assert repaired_wheel in filenames
357351
358- # Make sure we don't have libgfortran in the result
352+ # Make sure we don't have liba.so & libb.so in the result
359353 contents = zipfile .ZipFile (os .path .join (io_folder , repaired_wheel )).namelist ()
360- assert not any (x for x in contents if "/libgfortran " in x )
354+ assert not any (x for x in contents if "/liba" in x or "/libb " in x )
361355
362356 def test_build_wheel_with_binary_executable (
363357 self , any_manylinux_container , docker_python , io_folder
0 commit comments