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
+4
View File
@@ -17,6 +17,7 @@ from .options import Options
from .typing import PathOrStr, assert_never
from .util import (
CIBW_CACHE_PATH,
AlreadyBuiltWheelError,
BuildFrontend,
BuildSelector,
NonPlatformWheelError,
@@ -365,6 +366,9 @@ def build(options: Options, tmp_path: Path) -> None:
repaired_wheel = next(repaired_wheel_dir.glob("*.whl"))
if repaired_wheel.name in {wheel.name for wheel in built_wheels}:
raise AlreadyBuiltWheelError(repaired_wheel.name)
if build_options.test_command and options.globals.test_selector(config.identifier):
log.step("Testing wheel...")
# set up a virtual environment to install and test from, to make sure