mavenversioncmp.py
def isContained (version, versionConstraints):
  """ Checks if given version is contained in given version range

  """
  if not isinstance (versionConstraints, basestring):
    raise Exception ("Expecting version range to be a string")

  # split version by ranges
  versionRanges = [
    x.strip(',') for x in re.split (r'(.*[\)\]],)', versionConstraints) if x
  ]

  # if is contained in any range, then satisfies the rules
  for vr in versionRanges:
    if _isContained (version, vr):
      return True

  return False
 Checks if given version is contained in given version range

  
Checks if given version is contained in given version range
Checks if given version is contained in given version range
def isContained (version, versionConstraints):
  if not isinstance (versionConstraints, basestring):
    raise Exception ("Expecting version range to be a string")
  versionRanges = [
    x.strip(',') for x in re.split (r'(.*[\)\]],)', versionConstraints) if x
  ]
  for vr in versionRanges:
    if _isContained (version, vr):
      return True
  return False
def isContained ( version , versionConstraints ) : if not isinstance ( versionConstraints , basestring ) : raise Exception ( "Expecting version range to be a string" ) versionRanges = [ x . strip ( ',' ) for x in re . split ( r'(.*[\)\]],)' , versionConstraints ) if x ] for vr in versionRanges : if _isContained ( version , vr ) : return True return False
Checks if given version is contained in given version range
Checks if given version is contained in given version range
""" Checks if given version is contained in given version range

  """ # split version by ranges # if is contained in any range, then satisfies the rules
version
versionConstraints