@@ -253,7 +253,7 @@ def build_in_container(
253253 print (
254254 f"\n Found previously built wheel { compatible_wheel .name } , that's compatible with { config .identifier } . Skipping build step..."
255255 )
256- repaired_wheels = [ compatible_wheel ]
256+ repaired_wheel = compatible_wheel
257257 else :
258258 if build_options .before_build :
259259 log .step ("Running before_build..." )
@@ -325,14 +325,16 @@ def build_in_container(
325325 else :
326326 container .call (["mv" , built_wheel , repaired_wheel_dir ])
327327
328- repaired_wheels = container .glob (repaired_wheel_dir , "*.whl" )
328+ match container .glob (repaired_wheel_dir , "*.whl" ):
329+ case []:
330+ raise errors .RepairStepProducedNoWheelError ()
331+ case [repaired_wheel ]:
332+ pass
333+ case too_many :
334+ raise errors .RepairStepProducedMultipleWheelsError ([p .name for p in too_many ])
329335
330- if not repaired_wheels :
331- raise errors .RepairStepProducedNoWheelError ()
332-
333- for repaired_wheel in repaired_wheels :
334- if repaired_wheel .name in {wheel .name for wheel in built_wheels }:
335- raise errors .AlreadyBuiltWheelError (repaired_wheel .name )
336+ if repaired_wheel .name in {wheel .name for wheel in built_wheels }:
337+ raise errors .AlreadyBuiltWheelError (repaired_wheel .name )
336338
337339 if build_options .test_command and build_options .test_selector (config .identifier ):
338340 log .step ("Testing wheel..." )
@@ -374,14 +376,8 @@ def build_in_container(
374376 container .call (["sh" , "-c" , before_test_prepared ], env = virtualenv_env )
375377
376378 # Install the wheel we just built
377- # Note: If auditwheel produced two wheels, it's because the earlier produced wheel
378- # conforms to multiple manylinux standards. These multiple versions of the wheel are
379- # functionally the same, differing only in name, wheel metadata, and possibly include
380- # different external shared libraries. so it doesn't matter which one we run the tests on.
381- # Let's just pick the first one.
382- wheel_to_test = repaired_wheels [0 ]
383379 container .call (
384- [* pip , "install" , str (wheel_to_test ) + build_options .test_extras ],
380+ [* pip , "install" , str (repaired_wheel ) + build_options .test_extras ],
385381 env = virtualenv_env ,
386382 )
387383
@@ -394,7 +390,7 @@ def build_in_container(
394390 build_options .test_command ,
395391 project = container_project_path ,
396392 package = container_package_dir ,
397- wheel = wheel_to_test ,
393+ wheel = repaired_wheel ,
398394 )
399395
400396 test_cwd = testing_temp_dir / "test_cwd"
@@ -417,16 +413,13 @@ def build_in_container(
417413 # clean up test environment
418414 container .call (["rm" , "-rf" , testing_temp_dir ])
419415
420- # move repaired wheels to output
421- # TODO: can this still output multiple wheels? I though it was just multiple tags
416+ # move repaired wheel to output
422417 output_wheel : Path | None = None
423418 if compatible_wheel is None :
424419 container .call (["mkdir" , "-p" , container_output_dir ])
425- container .call (["mv" , * repaired_wheels , container_output_dir ])
426- built_wheels .extend (
427- container_output_dir / repaired_wheel .name for repaired_wheel in repaired_wheels
428- )
429- output_wheel = options .globals .output_dir / repaired_wheels [0 ].name
420+ container .call (["mv" , repaired_wheel , container_output_dir ])
421+ built_wheels .append (container_output_dir / repaired_wheel .name )
422+ output_wheel = options .globals .output_dir / repaired_wheel .name
430423
431424 log .build_end (output_wheel )
432425
0 commit comments