|
7 | 7 | import platform
|
8 | 8 |
|
9 | 9 | dir_repos = "repositories"
|
| 10 | +dir_extensions = "extensions" |
10 | 11 | python = sys.executable
|
11 | 12 | git = os.environ.get('GIT', "git")
|
12 | 13 | index_url = os.environ.get('INDEX_URL', "")
|
@@ -101,9 +102,24 @@ def version_check(commit):
|
101 | 102 | else:
|
102 | 103 | print("Not a git clone, can't perform version check.")
|
103 | 104 | except Exception as e:
|
104 |
| - print("versipm check failed",e) |
| 105 | + print("version check failed", e) |
| 106 | + |
| 107 | + |
| 108 | +def run_extensions_installers(): |
| 109 | + if not os.path.isdir(dir_extensions): |
| 110 | + return |
| 111 | + |
| 112 | + for dirname_extension in os.listdir(dir_extensions): |
| 113 | + path_installer = os.path.join(dir_extensions, dirname_extension, "install.py") |
| 114 | + if not os.path.isfile(path_installer): |
| 115 | + continue |
| 116 | + |
| 117 | + try: |
| 118 | + print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {dirname_extension}")) |
| 119 | + except Exception as e: |
| 120 | + print(e, file=sys.stderr) |
| 121 | + |
105 | 122 |
|
106 |
| - |
107 | 123 | def prepare_enviroment():
|
108 | 124 | torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113")
|
109 | 125 | requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
|
@@ -189,6 +205,8 @@ def prepare_enviroment():
|
189 | 205 |
|
190 | 206 | run_pip(f"install -r {requirements_file}", "requirements for Web UI")
|
191 | 207 |
|
| 208 | + run_extensions_installers() |
| 209 | + |
192 | 210 | if update_check:
|
193 | 211 | version_check(commit)
|
194 | 212 |
|
|
0 commit comments