From 661e277a1221f76b4522632abc0144e48f4e4b21 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 27 Aug 2024 15:35:33 -0700 Subject: [PATCH] Fix requirements.txt path. --- comfy_cli/uv.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/comfy_cli/uv.py b/comfy_cli/uv.py index 76c7629..057474d 100644 --- a/comfy_cli/uv.py +++ b/comfy_cli/uv.py @@ -246,10 +246,14 @@ def Download( "-m", "pip", "download", - "-r", - str(reqFile), ] + if isinstance(reqFile, (str, Path)): + cmd.extend(["-r", str(reqFile)]) + elif isinstance(reqFile, list): + for rf in reqFile: + cmd.extend(["-r", str(rf)]) + if extraUrl is not None: cmd.extend(["--extra-index-url", extraUrl]) @@ -271,14 +275,13 @@ def Wheel( out: Optional[PathLike] = None, ) -> subprocess.CompletedProcess[Any]: """For now, the `wheel` cmd has no uv support, so use pip""" - cmd = [ - str(executable), - "-m", - "pip", - "wheel", - "-r", - str(reqFile), - ] + cmd = [str(executable), "-m", "pip", "wheel"] + + if isinstance(reqFile, (str, Path)): + cmd.extend(["-r", str(reqFile)]) + elif isinstance(reqFile, list): + for rf in reqFile: + cmd.extend(["-r", str(rf)]) if extraUrl is not None: cmd.extend(["--extra-index-url", extraUrl]) @@ -288,7 +291,7 @@ def Wheel( if out is not None: cmd.extend(["-w", str(out)]) - + print(cmd) return _check_call(cmd, cwd) @staticmethod @@ -343,8 +346,8 @@ def __init__( DependencyCompiler.rocmPytorchUrl if self.gpu == GPU_OPTION.AMD else None ) # fmt: skip - self.out: Path = self.outDir / outName - self.override = self.outDir / "override.txt" + self.out: Path = self.cwd / outName + self.override = self.cwd / "override.txt" self.reqFilesCore = reqFilesCore if reqFilesCore is not None else self.find_core_reqs() self.reqFilesExt = reqFilesExt if reqFilesExt is not None else self.find_ext_reqs()