Skip to content

Commit

Permalink
remove same-named wheel before shutil.move
Browse files Browse the repository at this point in the history
In adobe-type-tools/afdko#595 we attempt to build a py2.py3 wheel
thus the filename of the wheel is the same as the previous ones, and it causes a shutil.Error
https://travis-ci.org/adobe-type-tools/afdko/jobs/424691105#L1460

just remove the previous existing file before moving the new one (they'll be identical anyway,
or at least they *should*).
  • Loading branch information
anthrotype committed Sep 6, 2018
1 parent 9f7fdbf commit c9fffab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,8 @@ def call(args, env=None, cwd=None, shell=False):
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)
7 changes: 5 additions & 2 deletions cibuildwheel/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,8 @@ def shell(args, env=None, cwd=None):
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)

0 comments on commit c9fffab

Please sign in to comment.