@@ -230,16 +230,13 @@ def test_build_repair_numpy(any_manylinux_container, docker_python, io_folder):
230
230
assert 'manylinux' not in orig_wheel
231
231
232
232
# Repair the wheel using the manylinux container
233
- repair_command = f'auditwheel repair --plat { policy } -w /io /io/{ orig_wheel } '
233
+ repair_command = \
234
+ f'auditwheel repair --plat { policy } --only-plat -w /io /io/{ orig_wheel } '
234
235
docker_exec (manylinux_ctr , repair_command )
235
236
filenames = os .listdir (io_folder )
236
-
237
237
assert len (filenames ) == 2
238
- repaired_wheels = [fn for fn in filenames if 'manylinux' in fn ]
239
- assert repaired_wheels == [
240
- f'numpy-{ NUMPY_VERSION } -{ PYTHON_ABI } -{ tag } .whl'
241
- ]
242
- repaired_wheel = repaired_wheels [0 ]
238
+ repaired_wheel = f'numpy-{ NUMPY_VERSION } -{ PYTHON_ABI } -{ tag } .whl'
239
+ assert repaired_wheel in filenames
243
240
output = docker_exec (manylinux_ctr , 'auditwheel show /io/' + repaired_wheel )
244
241
assert (
245
242
f'numpy-{ NUMPY_VERSION } -{ PYTHON_ABI } -{ tag } .whl is consistent'
@@ -282,15 +279,13 @@ def test_build_wheel_with_binary_executable(any_manylinux_container, docker_pyth
282
279
assert 'manylinux' not in orig_wheel
283
280
284
281
# Repair the wheel using the appropriate manylinux container
285
- repair_command = f'auditwheel repair --plat { policy } -w /io /io/{ orig_wheel } '
282
+ repair_command = \
283
+ f'auditwheel repair --plat { policy } --only-plat -w /io /io/{ orig_wheel } '
286
284
docker_exec (manylinux_ctr , repair_command )
287
285
filenames = os .listdir (io_folder )
288
286
assert len (filenames ) == 2
289
- repaired_wheels = [fn for fn in filenames if policy in fn ]
290
- # Wheel picks up newer symbols when built in manylinux2010
291
- expected_wheel_name = f'testpackage-0.0.1-py3-none-{ tag } .whl'
292
- assert repaired_wheels == [expected_wheel_name ]
293
- repaired_wheel = repaired_wheels [0 ]
287
+ repaired_wheel = f'testpackage-0.0.1-py3-none-{ tag } .whl'
288
+ assert repaired_wheel in filenames
294
289
output = docker_exec (manylinux_ctr , 'auditwheel show /io/' + repaired_wheel )
295
290
assert (
296
291
f'testpackage-0.0.1-py3-none-{ tag } .whl is consistent'
@@ -356,10 +351,8 @@ def test_build_wheel_with_image_dependencies(with_dependency, any_manylinux_cont
356
351
repair_command .format (policy = policy , orig_wheel = orig_wheel )])
357
352
filenames = os .listdir (io_folder )
358
353
assert len (filenames ) == 2
359
- repaired_wheels = [fn for fn in filenames if policy in fn ]
360
- expected_wheel_name = f'testdependencies-0.0.1-{ PYTHON_ABI } -{ tag } .whl'
361
- assert repaired_wheels == [expected_wheel_name ]
362
- repaired_wheel = repaired_wheels [0 ]
354
+ repaired_wheel = f'testdependencies-0.0.1-{ PYTHON_ABI } -{ tag } .whl'
355
+ assert repaired_wheel in filenames
363
356
output = docker_exec (manylinux_ctr , 'auditwheel show /io/' + repaired_wheel )
364
357
assert (
365
358
f'testdependencies-0.0.1-{ PYTHON_ABI } -{ tag } .whl is consistent'
@@ -452,17 +445,16 @@ def test_build_wheel_depending_on_library_with_rpath(any_manylinux_container, do
452
445
assert 'manylinux' not in orig_wheel
453
446
454
447
# Repair the wheel using the appropriate manylinux container
455
- repair_command = f'auditwheel repair --plat { policy } -w /io /io/{ orig_wheel } '
448
+ repair_command = \
449
+ f'auditwheel repair --plat { policy } --only-plat -w /io /io/{ orig_wheel } '
456
450
docker_exec (
457
451
manylinux_ctr ,
458
452
['bash' , '-c' , 'LD_LIBRARY_PATH=/auditwheel_src/tests/integration/testrpath/a:$LD_LIBRARY_PATH ' + repair_command ],
459
453
)
460
454
filenames = os .listdir (io_folder )
461
- repaired_wheels = [fn for fn in filenames if policy in fn ]
462
- # Wheel picks up newer symbols when built in manylinux2010
463
- expected_wheel_name = f'testrpath-0.0.1-{ PYTHON_ABI } -{ tag } .whl'
464
- assert expected_wheel_name in repaired_wheels
465
- repaired_wheel = expected_wheel_name
455
+ assert len (filenames ) == 2
456
+ repaired_wheel = f'testrpath-0.0.1-{ PYTHON_ABI } -{ tag } .whl'
457
+ assert repaired_wheel in filenames
466
458
output = docker_exec (manylinux_ctr , 'auditwheel show /io/' + repaired_wheel )
467
459
if PLATFORM in {'x86_64' , 'i686' }:
468
460
expect = f'manylinux_2_5_{ PLATFORM } '
@@ -514,7 +506,8 @@ def test_build_repair_multiple_top_level_modules_wheel(any_manylinux_container,
514
506
assert 'manylinux' not in orig_wheel
515
507
516
508
# Repair the wheel using the appropriate manylinux container
517
- repair_command = f'auditwheel repair --plat { policy } -w /io /io/{ orig_wheel } '
509
+ repair_command = \
510
+ f'auditwheel repair --plat { policy } --only-plat -w /io /io/{ orig_wheel } '
518
511
docker_exec (
519
512
manylinux_ctr ,
520
513
[
@@ -530,11 +523,9 @@ def test_build_repair_multiple_top_level_modules_wheel(any_manylinux_container,
530
523
],
531
524
)
532
525
filenames = os .listdir (io_folder )
533
- repaired_wheels = [fn for fn in filenames if policy in fn ]
534
- # Wheel picks up newer symbols when built in manylinux2010
535
- expected_wheel_name = f'multiple_top_level-1.0-{ PYTHON_ABI } -{ tag } .whl'
536
- assert repaired_wheels == [expected_wheel_name ]
537
- repaired_wheel = expected_wheel_name
526
+ assert len (filenames ) == 2
527
+ repaired_wheel = f'multiple_top_level-1.0-{ PYTHON_ABI } -{ tag } .whl'
528
+ assert repaired_wheel in filenames
538
529
output = docker_exec (manylinux_ctr , 'auditwheel show /io/' + repaired_wheel )
539
530
if PLATFORM in {'x86_64' , 'i686' }:
540
531
expect = f'manylinux_2_5_{ PLATFORM } '
@@ -590,7 +581,8 @@ def test_build_repair_wheel_with_internal_rpath(any_manylinux_container, docker_
590
581
assert 'manylinux' not in orig_wheel
591
582
592
583
# Repair the wheel using the appropriate manylinux container
593
- repair_command = f'auditwheel repair --plat { policy } -w /io /io/{ orig_wheel } '
584
+ repair_command = \
585
+ f'auditwheel repair --plat { policy } --only-plat -w /io /io/{ orig_wheel } '
594
586
docker_exec (
595
587
manylinux_ctr ,
596
588
[
@@ -605,11 +597,9 @@ def test_build_repair_wheel_with_internal_rpath(any_manylinux_container, docker_
605
597
],
606
598
)
607
599
filenames = os .listdir (io_folder )
608
- repaired_wheels = [fn for fn in filenames if policy in fn ]
609
- # Wheel picks up newer symbols when built in manylinux2010
610
- expected_wheel_name = f'internal_rpath-1.0-{ PYTHON_ABI } -{ tag } .whl'
611
- assert repaired_wheels == [expected_wheel_name ]
612
- repaired_wheel = expected_wheel_name
600
+ assert len (filenames ) == 2
601
+ repaired_wheel = f'internal_rpath-1.0-{ PYTHON_ABI } -{ tag } .whl'
602
+ assert repaired_wheel in filenames
613
603
output = docker_exec (manylinux_ctr , 'auditwheel show /io/' + repaired_wheel )
614
604
if PLATFORM in {'x86_64' , 'i686' }:
615
605
expect = f'manylinux_2_5_{ PLATFORM } '
@@ -676,7 +666,8 @@ def test_strip_wheel(any_manylinux_container, docker_python, io_folder):
676
666
[f'{ p } _{ PLATFORM } ' for p in list (MANYLINUX_IMAGES .keys ())] +
677
667
[f'{ p } _{ PLATFORM } ' for aliases in POLICY_ALIASES .values () for p in aliases ]
678
668
)
679
- def test_build_wheel_compat (target_policy , any_manylinux_container ,
669
+ @pytest .mark .parametrize ('only_plat' , [True , False ])
670
+ def test_build_wheel_compat (target_policy , only_plat , any_manylinux_container ,
680
671
docker_python , io_folder ):
681
672
# test building wheels with compatibility with older spec
682
673
# check aliases for older spec
@@ -694,18 +685,32 @@ def test_build_wheel_compat(target_policy, any_manylinux_container,
694
685
695
686
if PLATFORM in {'x86_64' , 'i686' }:
696
687
expect = f'manylinux_2_5_{ PLATFORM } '
688
+ expect_tag = f'manylinux_2_5_{ PLATFORM } .manylinux1_{ PLATFORM } '
697
689
else :
698
690
expect = f'manylinux_2_17_{ PLATFORM } '
691
+ expect_tag = f'manylinux_2_17_{ PLATFORM } .manylinux2014_{ PLATFORM } '
692
+
693
+ target_tag = target_policy
694
+ for pep600_policy , aliases in POLICY_ALIASES .items ():
695
+ policy_ = f'{ pep600_policy } _{ PLATFORM } '
696
+ aliases_ = [f'{ p } _{ PLATFORM } ' for p in aliases ]
697
+ if target_policy == policy_ or target_policy in aliases_ :
698
+ target_tag = f'{ policy_ } .{ "." .join (aliases_ )} '
699
699
700
+ only_plat_arg = '--only-plat' if only_plat else ''
700
701
# we shall ba able to repair the wheel for all targets
701
702
docker_exec (manylinux_ctr , [
702
703
'bash' , '-c' ,
703
- f'auditwheel -v repair --plat { target_policy } -w /io /io/{ orig_wheel } ' ])
704
+ f'auditwheel -v repair --plat { target_policy } { only_plat_arg } -w /io'
705
+ f' /io/{ orig_wheel } ' ])
704
706
filenames = os .listdir (io_folder )
705
- assert len (filenames ) >= 1
706
- repaired_wheels = [fn for fn in filenames if target_policy in fn ]
707
- assert len (repaired_wheels ) == 1
708
- repaired_wheel = repaired_wheels [0 ]
707
+ assert len (filenames ) == 2
708
+ if only_plat or target_tag == expect_tag :
709
+ repaired_tag = target_tag
710
+ else :
711
+ repaired_tag = f'{ expect_tag } .{ target_tag } '
712
+ repaired_wheel = f'testsimple-0.0.1-{ PYTHON_ABI } -{ repaired_tag } .whl'
713
+ assert repaired_wheel in filenames
709
714
output = docker_exec (manylinux_ctr , f'auditwheel show /io/{ repaired_wheel } ' )
710
715
assert (
711
716
f'is consistent with the following platform tag: "{ expect } "'
0 commit comments