fix: invalid version handling

https://github.com/ltdrdata/ComfyUI-Manager/issues/953
This commit is contained in:
Dr.Lt.Data 2024-08-14 01:53:28 +09:00
parent 74bf39ab27
commit d95b974941
4 changed files with 56 additions and 55 deletions

View File

@ -23,7 +23,7 @@ sys.path.append(glob_path)
import cm_global import cm_global
from manager_util import * from manager_util import *
version = [2, 48, 6] version = [2, 48, 7]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
@ -123,7 +123,7 @@ def is_installed(name):
if name.startswith('#'): if name.startswith('#'):
return True return True
pattern = r'([^<>!=]+)([<>!=]=?)([^ ]*)' pattern = r'([^<>!=]+)([<>!=]=?)([0-9.a-zA-Z]*)'
match = re.search(pattern, name) match = re.search(pattern, name)
if match: if match:

View File

@ -1,8 +1,9 @@
try: # DON'T USE StrictVersion - cannot handle pre_release version
from distutils.version import StrictVersion # try:
except: # from distutils.version import StrictVersion
print(f"[ComfyUI-Manager] 'distutils' package not found. Activating fallback mode for compatibility.") # except:
class StrictVersion: print(f"[ComfyUI-Manager] 'distutils' package not found. Activating fallback mode for compatibility.")
class StrictVersion:
def __init__(self, version_string): def __init__(self, version_string):
self.version_string = version_string self.version_string = version_string
self.major = 0 self.major = 0

View File

@ -448,7 +448,7 @@ def is_installed(name):
if name.startswith('#'): if name.startswith('#'):
return True return True
pattern = r'([^<>!=]+)([<>!=]=?)([^ ]*)' pattern = r'([^<>!=]+)([<>!=]=?)([0-9.a-zA-Z]*)'
match = re.search(pattern, name) match = re.search(pattern, name)
if match: if match:

View File

@ -1,7 +1,7 @@
[project] [project]
name = "comfyui-manager" name = "comfyui-manager"
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
version = "2.48.6" version = "2.48.7"
license = { file = "LICENSE.txt" } license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"] dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]