diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 09db2030..d073ecf7 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -130,5 +130,8 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be test_command_prepared = prepare_command(test_command, project=abs_project_dir) call(test_command_prepared, cwd=os.environ['HOME'], env=env, shell=True) - # we're all done here; move it to output - shutil.move(delocated_wheel, output_dir) + # we're all done here; move it to output (remove if already exists) + dst = os.path.join(output_dir, os.path.basename(delocated_wheel)) + if os.path.isfile(dst): + os.remove(dst) + shutil.move(delocated_wheel, dst) diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 1c2ed1d3..4118bd33 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -101,5 +101,8 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be test_command_prepared = prepare_command(test_command, project=abs_project_dir) shell([test_command_prepared], cwd='c:\\', env=env) - # we're all done here; move it to output - shutil.move(built_wheel, output_dir) + # we're all done here; move it to output (remove if already exists) + dst = os.path.join(output_dir, os.path.basename(built_wheel)) + if os.path.isfile(dst): + os.remove(dst) + shutil.move(built_wheel, dst)