'Adds constraint that we\'re within the range from one version to another.
:param stem.version.Version from_version: beginning of the comparison range
:param stem.version.Version to_version: end of the comparison range
:param bool from_inclusive: if comparison is inclusive with the starting version
:param bool to_inclusive: if comparison is inclusive with the ending version'

def in_range(self, from_version, to_version, from_inclusive=True, to_inclusive=False):

    if (from_inclusive and to_inclusive):
        new_rule = (lambda v: (from_version <= v <= to_version))
    elif from_inclusive:
        new_rule = (lambda v: (from_version <= v < to_version))
    else:
        new_rule = (lambda v: (from_version < v < to_version))
    self.rules.append(new_rule)
