in package.py [0:0]
def get_cycle_libs(args: Namespace) -> List[str]:
ret = [build_sdist()]
scalelib_file = "cyclecloud-scalelib-{}.tar.gz".format(SCALELIB_VERSION)
cyclecloud_api_file = "cyclecloud_api-{}-py2.py3-none-any.whl".format(
CYCLECLOUD_API_VERSION
)
scalelib_url = "https://github.com/Azure/cyclecloud-scalelib/archive/{}.tar.gz".format(
# scalelib_url = "https://suzhuhpcshare.blob.core.windows.net/testbuilds/cyclecloud-scalelib-{}.tar.gz".format(
SCALELIB_VERSION
)
print("WARNING: \nWARNING: Downloading CycleCloud API tarball from GridEngine Project until first release...\nWARNING: ")
cyclecloud_api_url = "https://github.com/Azure/cyclecloud-gridengine/releases/download/2.0.0/cyclecloud_api-8.0.1-py2.py3-none-any.whl"
to_download = {
scalelib_file: (args.scalelib, scalelib_url),
cyclecloud_api_file: (args.cyclecloud_api, cyclecloud_api_url),
}
for lib_file in to_download:
arg_override, url = to_download[lib_file]
if arg_override:
if not os.path.exists(arg_override):
print(arg_override, "does not exist", file=sys.stderr)
sys.exit(1)
fname = os.path.basename(arg_override)
orig = os.path.abspath(arg_override)
dest = os.path.abspath(os.path.join("libs", fname))
if orig != dest:
shutil.copyfile(orig, dest)
ret.append(fname)
else:
dest = os.path.join("libs", lib_file)
check_call(["curl", "-L", "-k", "-s", "-o", dest, url])
# PowerShell
# check_call(["wget", url, "-OutFile", dest])
ret.append(lib_file)
print("Downloaded", lib_file, "to")
return ret