Make sure all the downloadable files needed for wheel building exist and can be opened
(plats)
| 280 | |
| 281 | |
| 282 | def 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 | |
| 326 | def test_version(expected_version=None): |
no test coverage detected