|
261 | 261 | import numpy as np |
262 | 262 | msg += f"\nnumpy: {np.__version__}" |
263 | 263 | except: |
264 | | - pass |
| 264 | + msg += "\nnumpy: **not found!**" |
| 265 | + |
265 | 266 | print(msg) |
266 | 267 | if not logfile: |
267 | 268 | logfile = os.path.normpath(os.path.join(path2repo,'..','gitstrap.log')) |
@@ -460,9 +461,30 @@ def gitResetGSASII(repo_path,verbose=True): |
460 | 461 | if allBinaries: |
461 | 462 | tarURLs = GSASIIpath.getGitBinaryReleases().values() |
462 | 463 | else: |
463 | | - tarURLs = [GSASIIpath.getGitBinaryLoc(verbose=True, |
464 | | - npver=npVersion,pyver=pyVersion)] |
465 | | - print('tarURLs=',tarURLs,npVersion,pyVersion) |
| 464 | + # try to load the exact binary collection we want |
| 465 | + bindir = GSASIIpath.GetBinaryPrefix(pyVersion) |
| 466 | + if npVersion: |
| 467 | + inpver = GSASIIpath.intver(npVersion) |
| 468 | + else: |
| 469 | + inpver = GSASIIpath.intver(np.__version__) |
| 470 | + tar = bindir + '_n' + GSASIIpath.fmtver(inpver) |
| 471 | + try: |
| 472 | + # lookup latest release |
| 473 | + URL = 'https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/releases/latest' |
| 474 | + response = requests.get(URL, allow_redirects=False) |
| 475 | + if response.is_redirect or response.is_permanent_redirect: |
| 476 | + URL = response.headers.get('Location').replace('/tag/','/download/') |
| 477 | + if not URL.endswith('/'): URL += '/' |
| 478 | + tarURL = URL + tar + '.tgz' |
| 479 | + else: |
| 480 | + raise Exception |
| 481 | + GSASIIpath.InstallGitBinary(tarURL, installLoc, nameByVersion=True, |
| 482 | + verbose=True) |
| 483 | + tarURLs = [] |
| 484 | + except: |
| 485 | + # exact match is not present, look something that is close |
| 486 | + tarURLs = [GSASIIpath.getGitBinaryLoc(verbose=True, |
| 487 | + npver=npVersion,pyver=pyVersion)] |
466 | 488 | for tarURL in tarURLs: |
467 | 489 | if not tarURL: |
468 | 490 | print('no Binary URL found. Aborting installation') |
|
0 commit comments