def from_requirement(cls, provider, requirement, parent):
        """Build an instance from a requirement.
        """
        candidates = provider.find_matches(requirement)
        if not candidates:
            raise NoVersionsAvailable(requirement, parent)
        return cls(
            candidates=candidates,
            information=[RequirementInformation(requirement, parent)],
        )
def from_requirement ( cls , provider , requirement , parent ) : candidates = provider . find_matches ( requirement ) if not candidates : raise NoVersionsAvailable ( requirement , parent ) return cls ( candidates = candidates , information = [ RequirementInformation ( requirement , parent ) ] , )
Build an instance from a requirement.