'Check if supplied ToolRequirement matches this mapping description.
For it to match - the names must match. Additionally if the
requirement is created with a version or with unversioned being set to
True additional checks are needed. If a version is specified, it must
match the supplied version exactly. If ``unversioned`` is True, then
the supplied requirement must be unversioned (i.e. its version must be
set to ``None``).'

def matches_requirement(self, requirement):

    if (requirement.name != self.from_name):
        return False
    elif (self.from_version is None):
        return True
    elif (self.from_version is FROM_UNVERSIONED):
        return (requirement.version is None)
    else:
        return (requirement.version == self.from_version)
