for i, pkg in enumerate(
pip.pip.get_installed_distributions(local_only=True)):
if pkg._key == "studioml":
continue
if resources_needed is not None and \
int(resources_needed.get("gpus")) > 0 and \
(pkg._key == "tensorflow" or pkg._key == "tf-nightly"):
packages.insert(0, pkg._key + "-gpu==" + pkg._version)
After Change
if pkg.startswith("-e git+"):
// git package
packages.append(pkg)
elif "==" in pkg:
// pypi package
key = re.search(r"^.*?(?=\=\=)", pkg).group(0)
version = re.search(r"(?<=\=\=).*\Z", pkg).group(0)
if resources_needed is not None and \
int(resources_needed.get("gpus")) > 0:
if (key == "tensorflow" or key == "tf-nightly"):