def freeze(): '''Freeze the current environment (i.e. all installed packages).''' packages = [] for dist in installed_distributions(): packages.append('{0.project_name}=={0.version}'.format(dist)) return sorted(packages)
def __init__(self, skip=False): ## You should use skip=True when you want to upgrade a single package. ## Just do: ##>>> u = Updater(skip=True) ##>>> u.upgrade(package_name, json, version) if not skip: logger.debug('Loading list of installed packages... ', addn=False) self.working_set = list(installed_distributions()) logger.info('{0} packages loaded', len(self.working_set)) self.removed = {} self.yes = args_manager['update']['yes']