fix: error out if multiple wheels with the same name are produced

We shouldn't silently overwrite wheels that are produced in the same run that have the same filename, as this implies a misconfiguration.
This commit is contained in:
mayeut
2022-06-26 11:32:33 +02:00
parent 0696c94710
commit ef18186c45
5 changed files with 69 additions and 0 deletions
+5
View File
@@ -10,6 +10,7 @@ from .logger import log
from .options import Options
from .typing import OrderedDict, PathOrStr, assert_never
from .util import (
AlreadyBuiltWheelError,
BuildSelector,
NonPlatformWheelError,
find_compatible_wheel,
@@ -255,6 +256,10 @@ def build_on_docker(
repaired_wheels = docker.glob(repaired_wheel_dir, "*.whl")
for repaired_wheel in repaired_wheels:
if repaired_wheel.name in {wheel.name for wheel in built_wheels}:
raise AlreadyBuiltWheelError(repaired_wheel.name)
if build_options.test_command and build_options.test_selector(config.identifier):
log.step("Testing wheel...")