Create a range from a list of versions.

        This method creates a range that contains only the given versions and
        no other. Typically the range looks like (for eg) "==3|==4|==5.1".

        Args:
            versions: List of Version objects.

        Returns:
            `VersionRange` object.

def from_versions(cls, versions):
        """Create a range from a list of versions.

        This method creates a range that contains only the given versions and
        no other. Typically the range looks like (for eg) "==3|==4|==5.1".

        Args:
            versions: List of Version objects.

        Returns:
            `VersionRange` object.
        """
        range = cls(None)
        range.bounds = []
        for version in dedup(sorted(versions)):
            lower = _LowerBound(version, True)
            upper = _UpperBound(version, True)
            bound = _Bound(lower, upper)
            range.bounds.append(bound)
        return range