def get_keyring():
    """ Try to import and return optional keyring dependency. """
    try:
        import keyring
    except ImportError:
        raise ImportError(
            'Extra dependencies must be installed to use the keyring feature. Install them with `pip install bugwarrior[keyring]`.'
            )
    return keyring
