Perform upgrade of bcbio to latest release, or from GitHub development version.

    Handles bcbio, third party tools and data.
515920
def upgrade_bcbio(args):
    
    print("Upgrading bcbio")
    args = add_install_defaults(args)
    if args.upgrade in ["stable", "system", "deps", "development"]:
        if args.upgrade == "development":
            anaconda_dir = _update_conda_devel()
            _check_for_conda_problems()
            print("Upgrading bcbio-nextgen to latest development version")
            pip_bin = os.path.join(os.path.dirname(os.path.realpath(sys.executable)), "pip")
            git_tag = "@%s" % args.revision if args.revision != "master" else ""
            _pip_safe_ssl([[pip_bin, "install", "--upgrade", "--no-deps",
                            "git+%s%s#egg=bcbio-nextgen" % (REMOTES["gitrepo"], git_tag)]], anaconda_dir)
            print("Upgrade of bcbio-nextgen development code complete.")
        else:
            _update_conda_packages()
            _check_for_conda_problems()
            print("Upgrade of bcbio-nextgen code complete.")
    if args.cwl and args.upgrade:
        _update_bcbiovm()

    try:
        _set_matplotlib_default_backend()
    except OSError:
        pass

    if args.tooldir:
        with bcbio_tmpdir():
            print("Upgrading third party tools to latest versions")
            _symlink_bcbio(args, script="bcbio_nextgen.py")
            _symlink_bcbio(args, script="bcbio_setup_genome.py")
            _symlink_bcbio(args, script="bcbio_prepare_samples.py")
            _symlink_bcbio(args, script="bcbio_fastq_umi_prep.py")
            if args.cwl:
                _symlink_bcbio(args, "bcbio_vm.py", "bcbiovm")
                _symlink_bcbio(args, "python", "bcbiovm", "bcbiovm")
            upgrade_thirdparty_tools(args, REMOTES)
            print("Third party tools upgrade complete.")
    if args.toolplus:
        print("Installing additional tools")
        _install_toolplus(args)
    if args.install_data:
        for default in DEFAULT_INDEXES:
            if default not in args.aligners:
                args.aligners.append(default)
        if len(args.aligners) == 0:
            print("Warning: no aligners provided with `--aligners` flag")
        if len(args.genomes) == 0:
            print("Data not installed, no genomes provided with `--genomes` flag")
        else:
            with bcbio_tmpdir():
                print("Upgrading bcbio-nextgen data files")
                upgrade_bcbio_data(args, REMOTES)
                print("bcbio-nextgen data upgrade complete.")
    if args.isolate and args.tooldir:
        print("Isolated tool installation not automatically added to environmental variables")
        print(" Add:\n  {t}/bin to PATH".format(t=args.tooldir))
    save_install_defaults(args)
    args.datadir = _get_data_dir()
    _install_container_bcbio_system(args.datadir)
    print("Upgrade completed successfully.")
    return args
1222132
public function upgrade()
    {
        $this->upgradeDatabase();

        // now we refresh all blocks
        $manager = new Manager($this->app);
        $items = $manager->driver('block_type')->getItems($this->getPackageEntity());
        foreach ($items as $item) {
            $item->refresh();
        }

        Localization::clearCache();
    }
1330574
def update_from_pypi(self):
        """"""
        package = pypi.Package(self.package_name)
        self.licence = package.licence()
        if self.is_parseable:
            self.latest_version = package.latest_version()
            self.next_version = package.next_version(self.current_version)
            self.diff_status = pypi.version_diff(self.current_version, self.latest_version)
            self.python_support = package.python_support()
            self.django_support = package.django_support()
            self.supports_py3 = package.supports_py3()
        self.checked_pypi_at = tz_now()
        self.save()
        return self
1044308
def update(data)
      process_name(data) if data['name']
      process_version(data) if data['version']
      process_source(data) if data['source']
      process_data_provider(data) if data['data_provider']
      merge_dependencies(data) if data['dependencies']

      @data.merge!(data)
      return self
    end
1349773
def updater():
    
    print('%s Checking for updates' % run)
    # Changes must be separated by ;
    changes = '''major bug fixes;removed ninja mode;dropped python < 3.2 support;fixed unicode output;proxy support;more intels'''
    latest_commit = requester('https://raw.githubusercontent.com/s0md3v/Photon/master/core/updater.py', host='raw.githubusercontent.com')
    # Just a hack to see if a new version is available
    if changes not in latest_commit:
        changelog = re.search(r"changes = '''(.*?)'''", latest_commit)
        # Splitting the changes to form a list
        changelog = changelog.group(1).split(';')
        print('%s A new version of Photon is available.' % good)
        print('%s Changes:' % info)
        for change in changelog: # print changes
            print('%s>%s %s' % (green, end, change))

        current_path = os.getcwd().split('/') # if you know it, you know it
        folder = current_path[-1] # current directory name
        path = '/'.join(current_path) # current directory path
        choice = input('%s Would you like to update? [Y/n] ' % que).lower()

        if choice != 'n':
            print('%s Updating Photon' % run)
            os.system('git clone --quiet https://github.com/s0md3v/Photon %s'
                      % (folder))
            os.system('cp -r %s/%s/* %s && rm -r %s/%s/ 2>/dev/null'
                      % (path, folder, path, path, folder))
            print('%s Update successful!' % good)
    else:
        print('%s Photon is up to date!' % good)
1051510
def upgrade_many(upgrade=True, create_examples_all=True):
    
    urls = set()

    def inst(url):
        print('upgrading %s' % url)
        assert url not in urls
        urls.add(url)
        try:
            lib = install_lib(url, upgrade)
            print(' -> %s' % lib)
        except Exception as e:
            print(e)

    ############################
    # github.com
    ############################
    inst('https://github.com/sensorium/Mozzi/zipball/master')
    inst('https://github.com/madsci1016/Arduino-EasyTransfer/zipball/master')
    inst('https://github.com/sparkfun/SevSeg/zipball/master')
    inst(
        'https://github.com/madsci1016/Arduino-SoftEasyTransfer/zipball/master')
    inst('https://github.com/madsci1016/Arduino-PS2X/zipball/master')
# inst('http://github.com/wimleers/flexitimer2/zipball/v1.0')# can't install
    inst('https://github.com/kerinin/arduino-splines/zipball/master')
    inst('https://github.com/asynclabs/WiShield/zipball/master')
    inst('https://github.com/asynclabs/dataflash/zipball/master')
    inst('https://github.com/slugmobile/AtTouch/zipball/master')
    inst(
        'https://github.com/carlynorama/Arduino-Library-Button/zipball/master')
    inst(
        'https://github.com/carlynorama/Arduino-Library-FancyLED/zipball/master')
    inst('https://github.com/markfickett/arduinomorse/zipball/master')
    inst('https://github.com/rocketscream/Low-Power/zipball/master')
    inst(
        'https://github.com/arduino-libraries/CapacitiveSensor/zipball/master')

    ############################
    # arduiniana.org
    ############################
    # TODO: how to get latest version??
    inst('http://arduiniana.org/PString/PString2.zip')
    inst('http://arduiniana.org/Flash/Flash3.zip')
    inst('http://arduiniana.org/NewSoftSerial/NewSoftSerial10c.zip')
    inst('http://arduiniana.org/Streaming/Streaming4.zip')
    inst('http://arduiniana.org/PWMServo/PWMServo.zip')
    inst('http://arduiniana.org/TinyGPS/TinyGPS10.zip')

    ############################
    # google
    ############################
    # TODO: how to get latest version??
    # parse http://code.google.com/p/arduino-pinchangeint/downloads/list

    # simplified version in core
    inst('http://rogue-code.googlecode.com/files/Arduino-Library-Tone.zip')

    inst('http://arduino-playground.googlecode.com/files/LedDisplay03.zip')
    inst('http://sserial2mobile.googlecode.com/files/SSerial2Mobile-1.1.0.zip')
    inst('http://webduino.googlecode.com/files/webduino-1.4.1.zip')
    inst('http://arduino-pid-library.googlecode.com/files/PID_v1.0.1.zip')
    inst('http://ideoarduinolibraries.googlecode.com/files/Qtouch1Wire.zip')
    inst('http://arduino-timerone.googlecode.com/files/TimerOne-v8.zip')
    inst('http://arduinounit.googlecode.com/files/arduinounit-1.4.2.zip')
    inst('http://arduinode.googlecode.com/files/arduinode_0.1.zip')
    inst('http://arduino-edb.googlecode.com/files/EDB_r7.zip')
    inst('http://arduino-dblib.googlecode.com/files/DB.zip')
    inst(
        'http://morse-endecoder.googlecode.com/files/Morse_EnDecoder_2010.12.06.tar.gz')
    inst('http://arduino-pinchangeint.googlecode.com/files/PinChangeInt.zip')
    inst('http://arduino-tvout.googlecode.com/files/TVout_R5.91.zip')
    inst('http://narcoleptic.googlecode.com/files/Narcoleptic_v1a.zip')

    ############################
    # teensy
    ############################
    inst('http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip')
    inst('http://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip')
    inst('http://www.pjrc.com/teensy/arduino_libraries/FrequencyTimer2.zip')
    inst('http://www.pjrc.com/teensy/arduino_libraries/FreqCount.zip')
    inst('http://www.pjrc.com/teensy/arduino_libraries/FreqMeasure.zip')

    ############################
    # others
    ############################

# too big
#    inst('http://www.state-machine.com/arduino/qp_arduino.zip')

# The owner of this website (download.milesburton.com) has banned your access based on your browser's signature
#     inst('http://download.milesburton.com/Arduino/MaximTemperature/DallasTemperature_370Beta.zip')

    inst('http://www.shikadi.net/files/arduino/SerialIP-1.0.zip')
    inst(
        'http://siggiorn.com/wp-content/uploads/libraries/ArduinoByteBuffer.zip')
    inst(
        'http://siggiorn.com/wp-content/uploads/libraries/ArduinoSerialManager.zip')
    inst('http://arduino-tweet.appspot.com/Library-Twitter-1.2.2.zip')

# can't install
# inst('http://gkaindl.com/php/download.php?key=ArduinoEthernet')

    inst(
        'http://sebastian.setz.name/wp-content/uploads/2011/01/multiCameraIrControl_1-5.zip')
    inst('http://alexandre.quessy.net/static/avr/Tween_01.zip')
    inst(
        'http://www.lpelettronica.it/images/stories/LPM11162_images/Arduino/LPM11162_ArduinoLib_v1.zip')
    # inst('http://nootropicdesign.com/hackvision/downloads/Controllers.zip')
    inst(
        'http://interface.khm.de/wp-content/uploads/2009/01/FreqCounter_1_12.zip')
    inst(
        'http://interface.khm.de/wp-content/uploads/2010/06/FreqPeriod_1_12.zip')

    ############################
    # arduino.cc
    ############################
    inst('http://arduino.cc/playground/uploads/Main/PS2Keyboard002.zip')
    inst('http://arduino.cc/playground/uploads/Code/Metro.zip')
    inst('http://www.arduino.cc/playground/uploads/Main/MsTimer2.zip')

# can't install
# inst('http://www.arduino.cc/playground/uploads/Code/Time.zip')

    inst('http://arduino.cc/playground/uploads/Main/LedControl.zip')

# can't install
# inst('http://www.arduino.cc/playground/uploads/Code/ks0108GLCD.zip')#

    inst('http://arduino.cc/playground/uploads/Code/Bounce.zip')
    inst('http://arduino.cc/playground/uploads/Main/CapacitiveSense003.zip')
    inst('http://arduino.cc/playground/uploads/Main/PinChangeInt.zip')

# can't install
# inst('http://arduino.cc/playground/uploads/Code/TimerThree.zip')

    inst('http://arduino.cc/playground/uploads/Code/TimedAction-1_6.zip')

# can't install
# inst('http://www.arduino.cc/playground/uploads/Code/Time.zip')

    inst('http://arduino.cc/playground/uploads/Code/EventFuse.zip')
    inst('http://arduino.cc/playground/uploads/Code/Charlieplex.zip')
    inst('http://arduino.cc/playground/uploads/Code/DigitalToggle.zip')
    inst('http://arduino.cc/playground/uploads/Code/Enerlib.zip')

    inst('http://arduino.cc/playground/uploads/Code/AdvButton_11.zip')

    # old version
    # inst('http://arduino.cc/playground/uploads/Code/AdvButton.zip')

# can't install
# inst('http://arduino.cc/playground/uploads/Code/SerialDebugger.zip') #

    inst('http://arduino.cc/playground/uploads/Code/MatrixMath.zip')
    inst('http://arduino.cc/playground/uploads/Code/StackArray.zip')
    inst('http://arduino.cc/playground/uploads/Code/StackList.zip')
    inst('http://arduino.cc/playground/uploads/Code/QueueArray.zip')
    inst('http://arduino.cc/playground/uploads/Code/QueueList.zip')
    inst('http://arduino.cc/playground/uploads/Code/Ping-1_3.zip')
    inst('http://www.arduino.cc/playground/uploads/Code/LED.zip')

#    inst('')

    if create_examples_all:
        print('create "all" menu item')
        exampallcreate.create_examples_all()
    print('install finished')
505063
def update(ctx, no_restart, no_rebuild):
    """"""

    # 0. (NOT YET! MAKE A BACKUP OF EVERYTHING)
    # 1. update repository
    # 2. update frontend repository
    # 3. (Not yet: update venv)
    # 4. rebuild frontend
    # 5. restart service

    instance = ctx.obj['instance']

    log('Pulling github updates')
    run_process('.', ['git', 'pull', 'origin', 'master'])
    run_process('./frontend', ['git', 'pull', 'origin', 'master'])

    if not no_rebuild:
        log('Rebuilding frontend')
        install_frontend(instance, forcerebuild=True, install=False, development=True)

    if not no_restart:
        log('Restaring service')
        if instance != 'hfos':
            instance = 'hfos-' + instance

        run_process('.', ['sudo', 'systemctl', 'restart', instance])

    log('Done')
190349
def update(ctx, migrate=False):
    ''''''
    msg = 'Update all dependencies'
    if migrate:
        msg += ' and migrate data'
    header(msg)
    info('Updating Python dependencies')
    lrun('pip install -r requirements/develop.pip')
    lrun('pip install -e .')
    info('Updating JavaScript dependencies')
    lrun('npm install')
    if migrate:
        info('Migrating database')
        lrun('udata db migrate')
1080782
def upgrade():
    """"""
    op.create_table(
        'records_buckets',
        sa.Column(
            'record_id',
            sqlalchemy_utils.types.uuid.UUIDType(),
            nullable=False),
        sa.Column(
            'bucket_id',
            sqlalchemy_utils.types.uuid.UUIDType(),
            nullable=False),
        sa.ForeignKeyConstraint(['bucket_id'], [u'files_bucket.id'], ),
        sa.ForeignKeyConstraint(['record_id'], [u'records_metadata.id'], ),
        sa.PrimaryKeyConstraint('record_id', 'bucket_id')
    )
3615
def update(self, branch='default'):
        '''
        
        '''
        log.debug('Updating hg repo from hg_pillar module (pull)')
        self.repo.pull()
        log.debug('Updating hg repo from hg_pillar module (update)')
        self.repo.update(branch, clean=True)
135407
def upgrade():
    """"""
    op.drop_constraint(u'fk_access_actionsusers_user_id_accounts_user',
                       'access_actionsusers', type_='foreignkey')
    op.drop_index(op.f('ix_access_actionsusers_user_id'),
                  table_name='access_actionsusers')

    op.alter_column('access_actionsusers', 'user_id', nullable=False,
                    existing_type=sa.Integer())

    op.create_index(op.f('ix_access_actionsusers_user_id'),
                    'access_actionsusers', ['user_id'], unique=False)
    op.create_foreign_key(op.f('fk_access_actionsusers_user_id_accounts_user'),
                          'access_actionsusers', 'accounts_user', ['user_id'],
                          ['id'], ondelete='CASCADE')
1006093
def update():
    # type: () -> None
    
    branch = git.current_branch(refresh=True)
    develop = conf.get('git.devel_branch', 'develop')

    common.assert_branch_type('feature')
    common.git_checkout(develop)
    common.git_pull(develop)
    common.git_checkout(branch.name)
    common.git_merge(branch.name, develop)
1231470
def cli(ctx, organism_id, common_name, directory, blatdb="", species="", genus="", public=False):
    
    return ctx.gi.organisms.update_organism(organism_id, common_name, directory, blatdb=blatdb, species=species, genus=genus, public=public)
1370121
def _update_conda_packages():
    
    conda_bin = _get_conda_bin()
    channels = _get_conda_channels(conda_bin)
    assert conda_bin, ("Could not find anaconda distribution for upgrading bcbio.\n"
                       "Using python at %s but could not find conda." % (os.path.realpath(sys.executable)))
    req_file = "bcbio-update-requirements.txt"
    if os.path.exists(req_file):
        os.remove(req_file)
    subprocess.check_call(["wget", "-O", req_file, "--no-check-certificate", REMOTES["requirements"]])
    subprocess.check_call([conda_bin, "install", "--quiet", "--yes"] + channels +
                          ["--file", req_file])
    if os.path.exists(req_file):
        os.remove(req_file)
    return os.path.dirname(os.path.dirname(conda_bin))
440783
def release(ctx, type_, repo=None, prebump_to=PREBUMP):
    
    unprebump(ctx)
    if bump_release(ctx, type_=type_):
        return

    this_version = _read_version()
    ctx.run('towncrier')
    ctx.run(f'git commit -am "Release {this_version}"')
    ctx.run(f'git tag -fa {this_version} -m "Version {this_version}"')

    if repo:
        if upload(ctx, repo=repo):
            return
    else:
        print('[release] Missing --repo, skip uploading')

    prebump(ctx, type_=prebump_to)

    next_version = _read_version()
    ctx.run(f'git commit -am "Prebump to {next_version}"')
259511
def upgrade(self, flag):
        
        for pkg in self.binary:
            try:
                subprocess.call("upgradepkg {0} {1}".format(flag, pkg),
                                shell=True)
                check = pkg[:-4].split("/")[-1]
                if os.path.isfile(self.meta.pkg_path + check):
                    print("Completed!\n")
                else:
                    raise SystemExit()
            except subprocess.CalledProcessError:
                self._not_found("Can't upgrade", self.binary, pkg)
                raise SystemExit(1)
380712
def update_command(yes, development, development_version):
    
    # enforce that pip MUST be installed
    # Why not just include it in the setup.py requirements? Mostly weak
    # reasons, but it shouldn't matter much.
    # - if someone has installed the CLI without pip, then they haven't
    #   followed our install instructions, so it's mostly a non-issue
    # - we don't want to have `pip install -U globus-cli` upgrade pip -- that's
    #   a little bit invasive and easy to do by accident on modern versions of
    #   pip where `--upgrade-strategy` defaults to `eager`
    # - we may want to do distributions in the future with dependencies baked
    #   into a package, but we'd never want to do that with pip. More changes
    #   would be needed to support that use-case, which we've discussed, but
    #   not depending directly on pip gives us a better escape hatch
    # - if we depend on pip, we need to start thinking about what versions we
    #   support. In point of fact, that becomes an issue as soon as we add this
    #   command, but not being explicit about it lets us punt for now (maybe
    #   indefinitely) on figuring out version requirements. All of that is to
    #   say: not including it is bad, and from that badness we reap the rewards
    #   of procrastination and non-explicit requirements
    # - Advanced usage, like `pip install -t` can produce an installed version
    #   of the CLI which can't import its installing `pip`. If we depend on
    #   pip, anyone doing this is forced to get two copies of pip, which seems
    #   kind of nasty (even if "they're asking for it")
    if not _check_pip_installed():
        safeprint("`globus update` requires pip. " "Please install pip and try again")
        click.get_current_context().exit(1)

    # --development-version implies --development
    development = development or (development_version is not None)

    # if we're running with `--development`, then the target version is a
    # tarball from GitHub, and we can skip out on the safety checks
    if development:
        # default to master
        development_version = development_version or "master"
        target_version = (
            "https://github.com/globus/globus-cli/archive/{}" ".tar.gz#egg=globus-cli"
        ).format(development_version)
    else:
        # lookup version from PyPi, abort if we can't get it
        latest, current = get_versions()
        if latest is None:
            safeprint("Failed to lookup latest version. Aborting.")
            click.get_current_context().exit(1)

        # in the case where we're already up to date, do nothing and exit
        if current == latest:
            safeprint("You are already running the latest version: {}".format(current))
            return

        # if we're up to date (or ahead, meaning a dev version was installed)
        # then prompt before continuing, respecting `--yes`
        else:
            safeprint(
                (
                    "You are already running version {0}\n"
                    "The latest version is           {1}"
                ).format(current, latest)
            )
            if not yes and (
                not click.confirm("Continue with the upgrade?", default=True)
            ):
                click.get_current_context().exit(1)

        # if we make it through to here, it means we didn't hit any safe (or
        # unsafe) abort conditions, so set the target version for upgrade to
        # the latest
        target_version = "globus-cli=={}".format(latest)

    # print verbose warning/help message, to guide less fortunate souls who hit
    # Ctrl+C at a foolish time, lose connectivity, or don't invoke with `sudo`
    # on a global install of the CLI
    safeprint(
        (
            "The Globus CLI will now update itself.\n"
            "In the event that an error occurs or the update is interrupted, we "
            "recommend uninstalling and reinstalling the CLI.\n"
            "Update Target: {}\n"
        ).format(target_version)
    )

    # register the upgrade activity as an atexit function
    # this ensures that most library teardown (other than whatever libs might
    # jam into atexit themselves...) has already run, and therefore protects us
    # against most potential bugs resulting from upgrading click while a click
    # command is running
    #
    # NOTE: there is a risk that we will see bugs on upgrade if the act of
    # doing a pip upgrade install changes state on disk and we (or a lib we
    # use) rely on that via pkg_resources, lazy/deferred imports, or good
    # old-fashioned direct inspection of `__file__` and the like DURING an
    # atexit method. Anything outside of atexit methods remains safe!
    @atexit.register
    def do_upgrade():
        install_args = ["install", "--upgrade", target_version]
        if IS_USER_INSTALL:
            install_args.insert(1, "--user")
        _call_pip(*install_args)