Update package(s) (in an environment) by name.
518624
def update(self, *pkgs, **kwargs):
        """"""
        cmd_list = ['update', '--json', '--yes']

        if not pkgs and not kwargs.get('all'):
            raise TypeError("Must specify at least one package to update, or "
                            "all=True.")

        cmd_list.extend(
            self._setup_install_commands_from_kwargs(
                kwargs,
                ('dry_run', 'no_deps', 'override_channels',
                 'no_pin', 'force', 'all', 'use_index_cache', 'use_local',
                 'alt_hint')))

        cmd_list.extend(pkgs)

        return self._call_and_parse(cmd_list, abspath=kwargs.get('abspath',
                                                                 True))
1127680
async function updatePackageJSON (version) {
  ['package.json'].forEach(async fileName => {
    const filePath = path.resolve(__dirname, '..', fileName)
    const file = require(filePath)
    file.version = version
    await writeFile(filePath, JSON.stringify(file, null, 2))
  })
}
1286571
def update():
    """"""
    with settings(warn_only=True):
        print(cyan('\nInstalling/Updating required packages...'))

        pip = local('venv/bin/pip install -U --allow-all-external --src libs -r requirements.txt', capture=True)
        if pip.failed:
            print(red(pip))
            abort("pip exited with return code %i" % pip.return_code)

        print(green('Packages requirements updated.'))
1217179
def dependencies(self, name=None, prefix=None, pkgs=None, channels=None,
                     dep=True):
        """"""
        if not pkgs or not isinstance(pkgs, (list, tuple)):
            raise TypeError('must specify a list of one or more packages to '
                            'install into existing environment')

        cmd_list = ['install', '--dry-run', '--json', '--force-pscheck']

        if not dep:
            cmd_list.extend(['--no-deps'])

        if name:
            cmd_list.extend(['--name', name])
        elif prefix:
            cmd_list.extend(['--prefix', prefix])
        else:
            pass

        cmd_list.extend(pkgs)

        # TODO: Check if correct
        if channels:
            cmd_list.extend(['--override-channels'])

            for channel in channels:
                cmd_list.extend(['--channel'])
                cmd_list.extend([channel])

        return self._call_and_parse(cmd_list)
259995
def _update_sys_path(self, package_path=None):
        """"""
        self.package_path = package_path
        if not self.package_path in sys.path:
            sys.path.append(self.package_path)
165633
def package_version(self, prefix=None, name=None, pkg=None, build=False):
        """"""
        package_versions = {}

        if name and prefix:
            raise TypeError("Exactly one of 'name' or 'prefix' is required.")

        if name:
            prefix = self.get_prefix_envname(name)

        if self.environment_exists(prefix=prefix):

            for package in self.linked(prefix):
                if pkg in package:
                    n, v, b = self.split_canonical_name(package)
                    if build:
                        package_versions[n] = '{0}={1}'.format(v, b)
                    else:
                        package_versions[n] = v

        return package_versions.get(pkg)
251648
def update_vip(self, vip, body=None):
        """"""
        return self.put(self.vip_path % (vip), body=body)
830914
function updateAllPackages(rootPkgPath, packagesPath) {
  const paths = findPackages(packagesPath);

  return paths.reduce((promise, pkgPath) => promise.then(() => updateSinglePackage(rootPkgPath, pkgPath)), Promise.resolve());
}
1274432
def package_version(filename, varname):
    """"""
    _locals = {}
    with open(filename) as fp:
        exec(fp.read(), None, _locals)
    return _locals[varname]
866687
def upgrade_available(name, **kwargs):
    '''
    
    '''
    version = None
    cmd = ['pkg', 'list', '-Huv', name]
    lines = __salt__['cmd.run_stdout'](cmd).splitlines()
    if not lines:
        return {}
    ret = {}
    for line in lines:
        ret[_ips_get_pkgname(line)] = _ips_get_pkgversion(line)
    return ret
1125350
public function update()
    {
        foreach ((array) $this->package as $package) {
            $_POST['plugin64'] = $package;
            ob_start();
            plugin_install();
            ob_end_clean();
        }
    }
366372
def update_environment_variables(self, filename):
        """"""
        self.env.update(os.environ.copy())
        self.env.update({'PIPELINE_BASH_FILE': filename})
951044
def package_install(name, **kwargs):
    '''
    
    '''
    DETAILS = _load_state()
    if kwargs.get('version', False):
        version = kwargs['version']
    else:
        version = '1.0'
    DETAILS['packages'][name] = version
    _save_state(DETAILS)
    return {name: version}
250408
public void setPackagenames(String packages) {
        StringTokenizer tok = new StringTokenizer(packages, ",");
        while (tok.hasMoreTokens()) {
            String packageName = tok.nextToken();
            packageNames.add(packageName);
        }
    }
523208
def packages(ciprcfg, env, opts, console):
    
    for name, source in ciprcfg.packages.items():
        console.normal('- %s' % name)

        if opts.long_details:
            console.normal('  - directory: %s' % path.join(env.package_dir, name))
            console.normal('  - source: %s' % source)
56827
def get_canonical_names(packages):
    """"""
    from .vendor.packaging.utils import canonicalize_name

    if not isinstance(packages, Sequence):
        if not isinstance(packages, six.string_types):
            return packages
        packages = [packages]
    return set([canonicalize_name(pkg) for pkg in packages if pkg])
1304529
def patch_init_py(base_dir, name, version):
    """"""
    # Ensure main package dir is there (may be absent in script-only packages)
    package_dir = os.path.join(base_dir, name)
    if not os.path.isdir(package_dir):
        os.makedirs(package_dir)
    # Open top-level __init__.py and read whole file
    init_py = os.path.join(package_dir, '__init__.py')
    log.info("patching %s to bake in version '%s'" % (init_py, version))
    with open(init_py, 'r+') as init_file:
        lines = init_file.readlines()
        # Search for sentinels indicating version checking block
        try:
            begin = lines.index("# BEGIN VERSION CHECK\n")
            end = lines.index("# END VERSION CHECK\n")
        except ValueError:
            begin = end = len(lines)
        # Delete existing repo version checking block in file
        init_file.seek(0)
        init_file.writelines(lines[:begin] + lines[end+1:])
        # Append new version attribute to ensure it is authoritative, but only
        # if it is not already there (this happens in pip sdist installs)
        version_cmd = "__version__ = '{0}'\n".format(version)
        if not lines or lines[-1] != version_cmd:
            init_file.write("\n# Automatically added by katversion\n")
            init_file.write(version_cmd)
        init_file.truncate()