mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-24 09:13:42 +01:00
Ignore text in the version string when comparing them
This commit is contained in:
parent
a261a2d47d
commit
364902f8a1
@ -15,6 +15,7 @@ import traceback
|
|||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
import re
|
||||||
|
|
||||||
os_name = platform.system()
|
os_name = platform.system()
|
||||||
|
|
||||||
@ -225,6 +226,7 @@ def install_pkg_if_necessary(pkg_name, required_version):
|
|||||||
|
|
||||||
def version_str_to_tuple(ver_str):
|
def version_str_to_tuple(ver_str):
|
||||||
ver_str = ver_str.split("+")[0]
|
ver_str = ver_str.split("+")[0]
|
||||||
|
ver_str = re.sub("[^0-9.]", "", ver_str)
|
||||||
ver = ver_str.split(".")
|
ver = ver_str.split(".")
|
||||||
return tuple(map(int, ver))
|
return tuple(map(int, ver))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user