def METHOD_NAME(cls, module):
    """Plugin 工厂函数
    :param module:
    :return:
    """
    try:
        # alias, desc, version 为必需字段
        alias = module.__alias__
        desc = module.__desc__
        _ = module.__version__  # noqa
        author = getattr(module, '__author__', '')
        homepage = getattr(module, '__homepage__', '')
        dist_name = getattr(module, '__dist_name__', '')
    except AttributeError as e:
        raise InvalidPluginError(str(e)) from None
    else:
        return Plugin(module,
                      alias=alias,
                      desc=desc,
                      author=author,
                      homepage=homepage,
                      dist_name=dist_name)