def run(self): if sys.platform == 'win32': raise Exception("Symlinking scripts doesn't work with Windows") self.run_command("egg_info") if self.distribution.scripts: # run first to set up self.outfiles orig.install_scripts.run(self) else: self.outfiles = [] if self.no_ep: # don't install entry point scripts into .egg file! return # build distribution object ei_cmd = self.get_finalized_command("egg_info") dist = Distribution( ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), ei_cmd.egg_name, ei_cmd.egg_version, ) # fetch entry points and create symlinks to the targets for type_ in 'console', 'gui': group = type_ + '_scripts' for name, ep in dist.get_entry_map(group).items(): log.info('install_symlinked_scripts: %s: %s', group, ep) if os.sep in name: raise ValueError("Path separators not allowed in script names") self.symlink_script(name, ep)
def _register(self, dist:Distribution) -> None: assert check_argument_types() entries = dist.get_entry_map(self.namespace) if not entries: return try: for name in entries: plugin = entries[name].load() self.register(name, plugin) except pkg_resources.UnknownExtra: # pragma: no cover - TODO: Figure out how to test this. log.warning("Skipping registration of '{!r}' due to missing dependencies.".format(dist), exc_info=True) except ImportError: # pragma: no cover - TODO: Figure out how to test this. log.error("Skipping registration of '{!r}' due to uncaught error on import.".format(dist), exc_info=True)