File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,18 @@ def build(options: BuildOptions) -> None:
217
217
# clean up test environment
218
218
docker .call (['rm' , '-rf' , venv_dir ])
219
219
220
+ existing_output_files = docker .call (['ls' ], cwd = container_output_dir ).split ('\n ' )
221
+ for repaired_wheel in repaired_wheels :
222
+ if repaired_wheel .name in existing_output_files :
223
+ message = f'Created wheel ({ repaired_wheel } ) already exists in output directory.'
224
+ if 'abi3' in repaired_wheel .name :
225
+ message += ('\n '
226
+ "It looks like you are created wheels against Python's limited API/stable ABI;\n "
227
+ 'please limit your Python selection to a single version when building limited API\n '
228
+ 'wheels, with CIBW_BUILD.' )
229
+ log .error (message )
230
+ sys .exit (1 )
231
+
220
232
# move repaired wheels to output
221
233
docker .call (['mkdir' , '-p' , container_output_dir ])
222
234
docker .call (['mv' , * repaired_wheels , container_output_dir ])
Original file line number Diff line number Diff line change @@ -293,6 +293,16 @@ def build(options: BuildOptions) -> None:
293
293
# clean up
294
294
shutil .rmtree (venv_dir )
295
295
296
+ if (options .output_dir / repaired_wheel .name ).exists ():
297
+ message = f'Created wheel ({ repaired_wheel } ) already exists in output directory.'
298
+ if 'abi3' in repaired_wheel .name :
299
+ message += ('\n '
300
+ "It looks like you are created wheels against Python's limited API/stable ABI;\n "
301
+ 'please limit your Python selection to a single version when building limited API\n '
302
+ 'wheels, with CIBW_BUILD.' )
303
+ log .error (message )
304
+ sys .exit (1 )
305
+
296
306
# we're all done here; move it to output (overwrite existing)
297
307
shutil .move (str (repaired_wheel ), options .output_dir )
298
308
log .build_end ()
Original file line number Diff line number Diff line change @@ -323,6 +323,16 @@ def build(options: BuildOptions) -> None:
323
323
# clean up
324
324
shutil .rmtree (venv_dir )
325
325
326
+ if (options .output_dir / repaired_wheel .name ).exists ():
327
+ message = f'Created wheel ({ repaired_wheel } ) already exists in output directory.'
328
+ if 'abi3' in repaired_wheel .name :
329
+ message += ('\n '
330
+ "It looks like you are created wheels against Python's limited API/stable ABI;\n "
331
+ 'please limit your Python selection to a single version when building limited API\n '
332
+ 'wheels, with CIBW_BUILD.' )
333
+ log .error (message )
334
+ sys .exit (1 )
335
+
326
336
# we're all done here; move it to output (remove if already exists)
327
337
shutil .move (str (repaired_wheel ), options .output_dir )
328
338
log .build_end ()
You can’t perform that action at this time.
0 commit comments