def uninstall(self, auto_confirm=False): """ Uninstall the distribution currently satisfying this requirement. Prompts before removing or modifying files unless ``auto_confirm`` is True. Refuses to delete or modify files outside of ``sys.prefix`` - thus uninstallation within a virtual environment can only modify that virtual environment, even if the virtualenv is linked to global site-packages. """ if not self.check_if_exists(): raise UninstallationError( "Cannot uninstall requirement %s, not installed" % (self.name, )) dist = self.satisfied_by or self.conflicts_with dist_path = normalize_path(dist.location) if not dist_is_local(dist): logger.info( "Not uninstalling %s at %s, outside environment %s", dist.key, dist_path, sys.prefix, ) self.nothing_to_uninstall = True return if dist_path in get_stdlib(): logger.info( "Not uninstalling %s at %s, as it is in the standard library.", dist.key, dist_path, ) self.nothing_to_uninstall = True return self.uninstalled_pathset = UninstallPathSet.from_dist(dist) self.uninstalled_pathset.remove(auto_confirm)
def uninstall(self, auto_confirm=False): """ Uninstall the distribution currently satisfying this requirement. Prompts before removing or modifying files unless ``auto_confirm`` is True. Refuses to delete or modify files outside of ``sys.prefix`` - thus uninstallation within a virtual environment can only modify that virtual environment, even if the virtualenv is linked to global site-packages. """ if not self.check_if_exists(): raise UninstallationError( "Cannot uninstall requirement %s, not installed" % (self.name, )) dist = self.satisfied_by or self.conflicts_with self.uninstalled_pathset = UninstallPathSet.from_dist(dist) self.uninstalled_pathset.remove(auto_confirm)
def uninstall(self, auto_confirm=False): """ Uninstall the distribution currently satisfying this requirement. Prompts before removing or modifying files unless ``auto_confirm`` is True. Refuses to delete or modify files outside of ``sys.prefix`` - thus uninstallation within a virtual environment can only modify that virtual environment, even if the virtualenv is linked to global site-packages. """ if not self.check_if_exists(): raise UninstallationError( "Cannot uninstall requirement %s, not installed" % (self.name,) ) dist = self.satisfied_by or self.conflicts_with self.uninstalled_pathset = UninstallPathSet.from_dist(dist) self.uninstalled_pathset.remove(auto_confirm)