until recently directly comparing Tuple of strings work good enough but opencv-python updated to vesrion 4.10.x.x
when checking for opencv-python>=4.8.0
the Tuple of strings('4', '10', '0', '84') >= ('4', '8', '0') this retruns False
due to the string '10' is < string '8'
solution
as far as I'm aware the best way of passing version number is to use from packaging.version import parse
as this also handles more exotic version numbers such as the ones with suffixes
suffix like pytorch '2.1.2+cu121'
alternatively if you wish to not packaging then one could either write complex regex to handle special cases
or just assume that there's no special version numbers and simply convert str to int
which can be done by modifying comparable_version
def comparable_version(version: str) -> Tuple:
return tuple(int(v) for v in version.split("."))
recently on every launch install.py the message keep poping up on launch
this is due to improper version comparison in
install.py
comparable_version()
ininstall.py
retrunsTuple of strings
https://github.com/Mikubill/sd-webui-controlnet/blob/b63899a654ee2f70d475c259691f35ac67c320d4/install.py#L15-L16until recently directly comparing
Tuple of strings
work good enough but opencv-python updated to vesrion4.10.x.x
when checking for
opencv-python>=4.8.0
theTuple of strings
('4', '10', '0', '84')
>=('4', '8', '0')
this retrunsFalse
due to the string'10'
is < string'8'
solution
as far as I'm aware the best way of passing version number is to use
from packaging.version import parse
as this also handles more exotic version numbers such as the ones with suffixesalternatively if you wish to not packaging then one could either write complex regex to handle special cases or just assume that there's no special version numbers and simply convert str to int which can be done by modifying
comparable_version