MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / compare

Method compare

utils/install.py:256–278  ·  view source on GitHub ↗

# return 1 if self.version > version2 # return 0 if self.version == version2 # return -1 if self.version < version2 # return False if not comparable

(self, version2, separator=". |-", ignorecase=True)

Source from the content-addressed store, hash-verified

254 ]
255
256 def compare(self, version2, separator=". |-", ignorecase=True):
257 """
258 # return 1 if self.version > version2
259 # return 0 if self.version == version2
260 # return -1 if self.version < version2
261 # return False if not comparable
262 """
263 if "rc" in self.version and not "rc" in version2:
264 a = self._preprocess(
265 self.version.split("rc")[0].strip("-"), separator, ignorecase
266 )
267 b = b = self._preprocess(version2, separator, ignorecase)
268 if ((a > b) - (a < b)) == 0:
269 return -1
270 else:
271 return (a > b) - (a < b)
272 else:
273 a = self._preprocess(self.version, separator, ignorecase)
274 b = self._preprocess(version2, separator, ignorecase)
275 try:
276 return (a > b) - (a < b)
277 except:
278 return False
279
280
281SUPPORTED_PLATFORM_MACHINE = {

Callers 7

install_pluginsFunction · 0.45
set_constsFunction · 0.45
__init__Method · 0.45
bool_overloadMethod · 0.45
mainFunction · 0.45
install.pyFile · 0.45

Calls 1

_preprocessMethod · 0.95

Tested by

no test coverage detected