Skip to content

Commit 5c70089

Browse files
committed
allows --index-url in requirements.txt
#918
1 parent 1ede7df commit 5c70089

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

glob/manager_core.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import cm_global
2424
from manager_util import *
2525

26-
version = [2, 48, 3]
26+
version = [2, 48, 4]
2727
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
2828

2929

@@ -405,8 +405,14 @@ def execute_install_script(url, repo_path, lazy_mode=False, instant_execution=Fa
405405
with open(requirements_path, "r") as requirements_file:
406406
for line in requirements_file:
407407
package_name = remap_pip_package(line.strip())
408+
408409
if package_name and not package_name.startswith('#'):
409-
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
410+
if '--index-url' in package_name:
411+
s = package_name.split('--index-url')
412+
install_cmd = [sys.executable, "-m", "pip", "install", s[0].strip(), '--index-url', s[1].strip()]
413+
else:
414+
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
415+
410416
if package_name.strip() != "" and not package_name.startswith('#'):
411417
try_install_script(url, repo_path, install_cmd, instant_execution=instant_execution)
412418

@@ -1215,3 +1221,4 @@ def unzip(model_path):
12151221
os.remove(model_path)
12161222
return True
12171223

1224+

prestartup_script.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,12 @@ def msg_capture(stream, prefix):
532532
package_name = remap_pip_package(line.strip())
533533
if package_name and not is_installed(package_name):
534534
if not package_name.startswith('#'):
535-
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
535+
if '--index-url' in package_name:
536+
s = package_name.split('--index-url')
537+
install_cmd = [sys.executable, "-m", "pip", "install", s[0].strip(), '--index-url', s[1].strip()]
538+
else:
539+
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
540+
536541
this_exit_code += process_wrap(install_cmd, repo_path)
537542

538543
if os.path.exists(install_script_path) and f'{repo_path}/install.py' not in processed_install:
@@ -575,7 +580,12 @@ def execute_lazy_install_script(repo_path, executable):
575580
for line in requirements_file:
576581
package_name = remap_pip_package(line.strip())
577582
if package_name and not is_installed(package_name):
578-
install_cmd = [executable, "-m", "pip", "install", package_name]
583+
if '--index-url' in package_name:
584+
s = package_name.split('--index-url')
585+
install_cmd = [sys.executable, "-m", "pip", "install", s[0].strip(), '--index-url', s[1].strip()]
586+
else:
587+
install_cmd = [sys.executable, "-m", "pip", "install", package_name]
588+
579589
process_wrap(install_cmd, repo_path)
580590

581591
if os.path.exists(install_script_path) and f'{repo_path}/install.py' not in processed_install:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-manager"
33
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
4-
version = "2.48.3"
4+
version = "2.48.4"
55
license = { file = "LICENSE.txt" }
66
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]
77

0 commit comments

Comments
 (0)