MCPcopy Create free account
hub / github.com/numpy/numpy / test_setup

Function test_setup

tools/openblas_support.py:282–323  ·  view source on GitHub ↗

Make sure all the downloadable files needed for wheel building exist and can be opened

(plats)

Source from the content-addressed store, hash-verified

280
281
282def test_setup(plats):
283 '''
284 Make sure all the downloadable files needed for wheel building
285 exist and can be opened
286 '''
287 def items():
288 """ yields all combinations of arch, ilp64
289 """
290 for plat in plats:
291 yield plat, None
292 osname, arch = plat.split("-")
293 if arch not in ('i686', '32'):
294 yield plat, '64_'
295
296 errs = []
297 for plat, ilp64 in items():
298 osname, _ = plat.split("-")
299 if plat not in plats:
300 continue
301 target = None
302 try:
303 try:
304 target = setup_openblas(plat, ilp64)
305 except Exception as e:
306 print(f'Could not setup {plat} with ilp64 {ilp64}, ')
307 print(e)
308 errs.append(e)
309 continue
310 if not target:
311 raise RuntimeError(f'Could not setup {plat}')
312 print('success with', plat, ilp64)
313 files = glob.glob(os.path.join(target, "lib", "*.a"))
314 if not files:
315 raise RuntimeError("No lib/*.a unpacked!")
316 finally:
317 if target:
318 if os.path.isfile(target):
319 os.unlink(target)
320 else:
321 shutil.rmtree(target)
322 if errs:
323 raise errs[0]
324
325
326def test_version(expected_version=None):

Callers 1

Calls 5

itemsFunction · 0.85
setup_openblasFunction · 0.85
printFunction · 0.85
splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected