'Return a pkg_resources.Distribution built from self.egg_info_path'

def get_dist(self):

    egg_info = self.egg_info_path('').rstrip('/')
    base_dir = os.path.dirname(egg_info)
    metadata = pkg_resources.PathMetadata(base_dir, egg_info)
    dist_name = os.path.splitext(os.path.basename(egg_info))[0]
    return pkg_resources.Distribution(os.path.dirname(egg_info), project_name=dist_name, metadata=metadata)
