def run(options): safe_rmtree('dist') urls = get_file_urls(options) completed = 0 exc = None with concurrent.futures.ThreadPoolExecutor() as e: fut_to_url = {e.submit(download_file, url): url for url in urls} for fut in concurrent.futures.as_completed(fut_to_url): url = fut_to_url[fut] try: local_fname = fut.result() except Exception: printerr("error while downloading %s" % (url)) raise else: completed += 1 print("downloaded %-45s %s" % (local_fname, bytes2human(os.path.getsize(local_fname)))) # 2 wheels (32 and 64 bit) per supported python version expected = len(PY_VERSIONS) * 2 if expected != completed: return exit("expected %s files, got %s" % (expected, completed)) if exc: return exit() rename_27_wheels()
def get_release(): # XXX do it in one git command output = _run_command(['git', 'branch']) for line in output.splitlines(): if line.startswith('*'): branch = line[2:] break output = _run_command(['git', 'describe', '--tags', '--always']).strip() if not '-' in output: return output version, delta, sha = output.split('-') if branch == 'master': #return '-'.join((version, delta, sha)) return sha #return '-'.join((branch, version, delta, sha)) return '-'.join((branch, sha)) def get_git_files(): files = _run_command(['git', 'ls-files']) return [ name.strip() for name in files.splitlines() ] if __name__ == '__main__': try: print get_release() except: printerr('%s: unable to read info' % basename(argv[0]))
return False return True def get_release(): # XXX do it in one git command output = _run_command(['git', 'branch']) for line in output.splitlines(): if line.startswith('*'): branch = line[2:] break output = _run_command(['git', 'describe', '--tags']).strip() if not '-' in output: return output version, delta, sha = output.split('-') if branch == 'master': return '-'.join((version, delta, sha)) return '-'.join((branch, version, delta, sha)) def get_git_files(): files = _run_command(['git', 'ls-files']) return [name.strip() for name in files.splitlines()] if __name__ == '__main__': try: print get_release() except: printerr('%s: unable to read info' % basename(argv[0]))
return False return True def get_release(): # XXX do it in one git command output = _run_command(["git", "branch"]) for line in output.splitlines(): if line.startswith("*"): branch = line[2:] break output = _run_command(["git", "describe", "--tags", "--always"]).strip() if not "-" in output: return output version, delta, sha = output.split("-") if branch == "master": return "-".join((version, delta, sha)) return "-".join((branch, version, delta, sha)) def get_git_files(): files = _run_command(["git", "ls-files"]) return [name.strip() for name in files.splitlines()] if __name__ == "__main__": try: print get_release() except: printerr("%s: unable to read info" % basename(argv[0]))