From e38eefe0bd903f5562493eca7ecebc0632a8ae6b Mon Sep 17 00:00:00 2001 From: HR Wu <5631010+heiruwu@users.noreply.github.com> Date: Fri, 6 Dec 2024 18:25:37 +0800 Subject: [PATCH] chore(cli): update join pkg str (#248) Because - update join pkg str This commit - update join pkg str --- instill/helpers/cli.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/instill/helpers/cli.py b/instill/helpers/cli.py index 1f5283d..d41d3f9 100644 --- a/instill/helpers/cli.py +++ b/instill/helpers/cli.py @@ -175,23 +175,22 @@ def build(args): else: cuda_suffix = "-gpu" - system_str = "" + system_pkg_list = [] if ( "system_packages" in build_params and not build_params["system_packages"] is None ): - for p in build_params["system_packages"]: - system_str += p + " " + system_pkg_list.extend(build_params["system_packages"]) + system_pkg_str = " ".join(system_pkg_list) - packages_str = "" + python_pkg_list = [] if ( "python_packages" in build_params and not build_params["python_packages"] is None ): - for p in build_params["python_packages"]: - packages_str += p + " " - for p in DEFAULT_DEPENDENCIES: - packages_str += p + " " + python_pkg_list.extend(build_params["python_packages"]) + python_pkg_list.extend(DEFAULT_DEPENDENCIES) + python_pkg_str = " ".join(python_pkg_list) with tempfile.TemporaryDirectory() as tmpdir: shutil.copyfile( @@ -222,9 +221,9 @@ def build(args): "--build-arg", f"CUDA_SUFFIX={cuda_suffix}", "--build-arg", - f"PACKAGES={packages_str}", + f"PACKAGES={python_pkg_str}", "--build-arg", - f"SYSTEM_PACKAGES={system_str}", + f"SYSTEM_PACKAGES={system_pkg_str}", "--build-arg", f"SDK_VERSION={instill_version}", "--platform",