fixed: use pyproject.toml if desktop version

- desktop version doesn't contains .git

modified: don't cache the sub fetched data of cnr
This commit is contained in:
Dr.Lt.Data
2025-03-05 21:15:47 +09:00
parent d649ca47c6
commit f406d728cc
3 changed files with 38 additions and 13 deletions

View File

@@ -23,6 +23,7 @@ import yaml
import zipfile
import traceback
from concurrent.futures import ThreadPoolExecutor, as_completed
import toml
orig_print = print
@@ -81,6 +82,24 @@ def get_comfyui_tag():
return None
def get_current_comfyui_ver():
"""
Extract version from pyproject.toml
"""
toml_path = os.path.join(comfy_path, 'pyproject.toml')
if not os.path.exists(toml_path):
return None
else:
try:
with open(toml_path, "r", encoding="utf-8") as f:
data = toml.load(f)
project = data.get('project', {})
return project.get('version')
except:
return None
def get_script_env():
new_env = os.environ.copy()
git_exe = get_config().get('git_exe')
@@ -154,7 +173,7 @@ def check_invalid_nodes():
# read env vars
comfy_path = os.environ.get('COMFYUI_PATH')
comfy_path: str = os.environ.get('COMFYUI_PATH')
comfy_base_path = os.environ.get('COMFYUI_FOLDERS_BASE_PATH')
if comfy_path is None: