'Load modules from querying the specified setuptools entrypoint name.
Return the number of loaded plugins.'

def load_setuptools_entrypoints(self, entrypoint_name):

    from pkg_resources import iter_entry_points, DistributionNotFound, VersionConflict
    for ep in iter_entry_points(entrypoint_name):
        if (self.get_plugin(ep.name) or self.is_blocked(ep.name)):
            continue
        try:
            plugin = ep.load()
        except DistributionNotFound:
            continue
        except VersionConflict as e:
            raise PluginValidationError(('Plugin    %r    could    not    be    loaded:    %s!' % (ep.name, e)))
        self.register(plugin, name=ep.name)
        self._plugin_distinfo.append((plugin, ep.dist))
    return len(self._plugin_distinfo)
