def fresh_working_set():
    """return a pkg_resources "working set", representing the *currently* installed packages"""
    class WorkingSetPlusEditableInstalls(pkg_resources.WorkingSet):

        def __init__(self, *args, **kwargs):
            self._normalized_name_mapping = {}
            super(WorkingSetPlusEditableInstalls, self).__init__(*args, **kwargs)

        def add_entry(self, entry):
            """Same as the original .add_entry, but sets only=False, so that egg-links are honored."""
            logger.debug('working-set entry: %r', entry)
            self.entry_keys.setdefault(entry, [])
            self.entries.append(entry)
            for dist in pkg_resources.find_distributions(entry, False):

                # eggs override anything that's installed normally
                # fun fact: pkg_resources.working_set's results depend on the
                # ordering of os.listdir since the order of os.listdir is
                # entirely arbitrary (an implemenation detail of file system),
                # without calling site.main(), an .egg-link file may or may not
                # be honored, depending on the filesystem
                replace = (dist.precedence == pkg_resources.EGG_DIST)
                self._normalized_name_mapping[normalize_name(dist.key)] = dist.key
                self.add(dist, entry, False, replace=replace)

        def find_normalized(self, req):
            req = _package_req_to_pkg_resources_req(str(req))
            req.key = self._normalized_name_mapping.get(normalize_name(req.key), req.key)
            return self.find(req)

    return WorkingSetPlusEditableInstalls()
return a pkg_resources "working set", representing the *currently* installed packages