@@ -104,11 +104,11 @@ def docker_container_ctx(image, io_dir=None, env_variables={}):
104
104
container .remove (force = True )
105
105
106
106
107
- def docker_exec (container , cmd ):
107
+ def docker_exec (container , cmd , expected_retcode = 0 ):
108
108
logger .info ("docker exec %s: %r" , container .id [:12 ], cmd )
109
109
ec , output = container .exec_run (cmd )
110
110
output = output .decode (ENCODING )
111
- if ec != 0 :
111
+ if ec != expected_retcode :
112
112
print (output )
113
113
raise CalledProcessError (ec , cmd , output = output )
114
114
return output
@@ -379,6 +379,7 @@ def test_build_repair_pure_wheel(any_manylinux_container, io_folder):
379
379
# If six has already been built and put in cache, let's reuse this.
380
380
shutil .copy2 (op .join (WHEEL_CACHE_FOLDER , policy , ORIGINAL_SIX_WHEEL ),
381
381
op .join (io_folder , ORIGINAL_SIX_WHEEL ))
382
+ logger .info ("Copied six wheel from {} to {}" .format (WHEEL_CACHE_FOLDER , io_folder ))
382
383
else :
383
384
docker_exec (manylinux_ctr , 'pip wheel -w /io --no-binary=:all: six==1.11.0' )
384
385
os .makedirs (op .join (WHEEL_CACHE_FOLDER , policy ), exist_ok = True )
@@ -394,21 +395,13 @@ def test_build_repair_pure_wheel(any_manylinux_container, io_folder):
394
395
repair_command = (
395
396
'auditwheel repair --plat {policy} -w /io /io/{orig_wheel}'
396
397
).format (policy = policy , orig_wheel = orig_wheel )
397
- docker_exec (manylinux_ctr , repair_command )
398
- filenames = os .listdir (io_folder )
399
- assert len (filenames ) == 1 # no new wheels
400
- assert filenames == [ORIGINAL_SIX_WHEEL ]
398
+ output = docker_exec (manylinux_ctr , repair_command , expected_retcode = 1 )
399
+ assert "This does not look like a platform wheel" in output
401
400
402
- output = docker_exec (manylinux_ctr , 'auditwheel show /io/' + filenames [0 ])
403
- expected = 'manylinux1' if PLATFORM in {'x86_64' , 'i686' } else 'manylinux2014'
404
- assert '' .join ([
405
- ORIGINAL_SIX_WHEEL ,
406
- ' is consistent with the following platform tag: ' ,
407
- '"{}_{}". ' .format (expected , PLATFORM ),
408
- 'The wheel references no external versioned symbols from system- ' ,
409
- 'provided shared libraries. ' ,
410
- 'The wheel requires no external shared libraries! :)' ,
411
- ]) in output .replace ('\n ' , ' ' )
401
+ output = docker_exec (manylinux_ctr , 'auditwheel show /io/{orig_wheel}'
402
+ .format (orig_wheel = orig_wheel ),
403
+ expected_retcode = 1 )
404
+ assert "This does not look like a platform wheel" in output
412
405
413
406
414
407
@pytest .mark .parametrize ('dtag' , ['rpath' , 'runpath' ])
0 commit comments