def _key_from_req(req):
    """Get an all-lowercase version of the requirement's name."""
    if hasattr(req, 'key'):
        key = req.key
    else:
        key = req.name
    key = key.replace('_', '-').lower()
    return key
