Append version number to lsqfit/__init__.py
166518
def run(self):
        
        with open('src/lsqfit/__init__.py', 'a') as lsfile:
            lsfile.write("\n__version__ = '%s'\n" % LSQFIT_VERSION)
        _build_py.run(self)
1264042
def _init_obo_version(self, line):
        """"""
        if line[0:14] == "format-version":
            self.format_version = line[16:-1]
        if line[0:12] == "data-version":
            self.data_version = line[14:-1]
516839
async function updateVersion(file) {
  const { default: config } = await import(`${CONFIGS_PATH}/${file}`);
  const { packageName } = config;

  const packageInfoFile = `${PACKAGES_PATH}/${packageName}/package.json`;
  const { default: packageInfo } = await import(packageInfoFile);

  if (info.version !== packageInfo.version) {
    const newPackageInfo = {
      ...packageInfo,
      version: info.version,
    };

    writeFileAsync(packageInfoFile, JSON.stringify(newPackageInfo, null, '  '))
      .then(
        () => console.log(`Updated ${packageName} to ${info.version}`),
        error => console.log(error),
      );
  }
}
1188591
def _write_template(upgrade_file, name, depends_on, repository, auto=False):
    """"""
    if auto:
        # Ensure all models are loaded
        from invenio_db import models
        list(models)
        template_args = produce_upgrade_operations()
        operations_str = template_args['upgrades']
        import_str = template_args['imports']
    else:
        operations_str = "    pass"
        import_str = ""

    with open(upgrade_file, 'w') as f:
        f.write(UPGRADE_TEMPLATE % {
            'depends_on': depends_on,
            'repository': repository,
            'year': date.today().year,
            'operations': operations_str,
            'imports': import_str,
            'cls': ''.join(w.capitalize() or '_' for w in name.split('_'))
        })
1327532
def init(name, runtime):
    """"""
    runtime = click.unstyle(runtime)

    stdout.write(
        style.format_command(
            'Initializing',
            '%s %s %s' % (name, style.gray('@'), style.green(runtime))
        )
    )

    config = Config(os.getcwd())
    config.set('runtime', runtime)
    config.save()

    generate.main(['init', name], standalone_mode=False)
    run.main(['python', 'manage.py', 'migrate'])
1304098
def _add_defaults_python(self):
        """"""
        if self.distribution.has_pure_modules():
            build_py = self.get_finalized_command('build_py')
            self.filelist.extend(build_py.get_source_files())
            # This functionality is incompatible with include_package_data, and
            # will in fact create an infinite recursion if include_package_data
            # is True.  Use of include_package_data will imply that
            # distutils-style automatic handling of package_data is disabled
            if not self.distribution.include_package_data:
                for _, src_dir, _, filenames in build_py.data_files:
                    self.filelist.extend([os.path.join(src_dir, filename)
                                          for filename in filenames])
1066867
def auto_create_version(class_name, version, filename="__init__.py"):
    
    version_filename = Path(
        "{classname}/{filename}".format(classname=class_name,
                                        filename=filename))
    with open(version_filename, "r") as f:
        content = f.read()

    if content != '__version__ = "{0}"'.format(version):
        banner("Updating version to {0}".format(version))
        with open(version_filename, "w") as text_file:
            text_file.write('__version__ = "{0:s}"'.format(version))
845248
function setVersion(type, suffix) {
        var file = 'package.json',
            VERSION_REGEX = /([\'|\"]version[\'|\"][ ]*:[ ]*[\'|\"])([\d|.]*)(-\w+)*([\'|\"])/,
            contents = grunt.file.read(file),
            version;
        contents = contents.replace(VERSION_REGEX, function(match, left, center) {
            version = center;
            if (type) {
                version = require('semver').inc(version, type);
            }
            //semver.inc strips our suffix if it existed
            if (suffix) {
                version += '-' + suffix;
            }
            return left + version + '"';
        });
        grunt.log.ok('Version set to ' + version.cyan);
        grunt.file.write(file, contents);
        return version;
    }
45138
def upsert(version, stack, ini, dryrun, yaml, no_poll, work_directory):
    
    ini_data = read_config_info(ini)
    if 'environment' not in ini_data:
        print('[environment] section is required in the INI file')
        sys.exit(1)

    if version:
        ini_data['codeVersion'] = version
    else:
        ini_data['codeVersion'] = str(int(time.time()))

    if 'region' not in ini_data['environment']:
        ini_data['environment']['region'] = find_myself()

    ini_data['yaml'] = bool(yaml)
    ini_data['no_poll'] = bool(no_poll)
    ini_data['dryrun'] = bool(dryrun)

    if stack:
        ini_data['environment']['stack_name'] = stack

    if work_directory:
        try:
            os.chdir(work_directory)
        except Exception as wtf:
            logging.error(wtf)
            sys.exit(2)

    print(json.dumps(ini_data, indent=2))
    start_upsert(ini_data)
1369171
def installFuncVersionedLib(target, source, env):
    """"""
    try:
        install = env['INSTALLVERSIONEDLIB']
    except KeyError:
        raise SCons.Errors.UserError('Missing INSTALLVERSIONEDLIB construction variable.')

    assert len(target)==len(source), \
           "Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target)))
    for t,s in zip(target,source):
        if hasattr(t.attributes, 'shlibname'):
            tpath = os.path.join(t.get_dir(), t.attributes.shlibname)
        else:
            tpath = t.get_path()
        if install(tpath,s.get_path(),env):
            return 1

    return 0
61109
def version(verbose):
    """"""
    print(Fore.BLUE + '-=' * 15)
    print(Fore.YELLOW + 'Superset ' + Fore.CYAN + '{version}'.format(
        version=config.get('VERSION_STRING')))
    print(Fore.BLUE + '-=' * 15)
    if verbose:
        print('[DB] : ' + '{}'.format(db.engine))
    print(Style.RESET_ALL)
279586
function setVersion(versionType, versionFull) {
        versionType.version = versionFull;
        var versionArray = versionFull.split(".");
        if (versionArray.length > 0) {
            versionArray = versionArray.reverse();
            versionType.major = versionArray.pop();
            if (versionArray.length > 0) {
                versionType.minor = versionArray.pop();
                if (versionArray.length > 0) {
                    versionArray = versionArray.reverse();
                    versionType.patch = versionArray.join(".");
                } else {
                    versionType.patch = "0";
                }
            } else {
                versionType.minor = "0";
            }
        } else {
            versionType.major = "0";
        }
    }
928059
def create_package_version(requirement):
    """"""
    try:
        PackageVersion(requirement=requirement).save()
        logger.info("Package '%s' added.", requirement.name)  # noqa
    except IntegrityError:
        logger.info("Package '%s' already exists.", requirement.name)
592956
def _update_version_data(self, result, info):
        
        name = info.pop('name')
        version = info.pop('version')
        if version in result:
            dist = result[version]
            md = dist.metadata
        else:
            dist = make_dist(name, version, scheme=self.scheme)
            md = dist.metadata
        dist.digest = self._get_digest(info)
        if md.source_url != info['url']:
            md.source_url = self.prefer_url(md.source_url, info['url'])
        dist.locator = self
        result[version] = dist
72714
def _release_version():
    '''
    
    '''
    with io.open(os.path.join(SETUP_DIRNAME, 'saltpylint', 'version.py'), encoding='utf-8') as fh_:
        exec_locals = {}
        exec_globals = {}
        contents = fh_.read()
        if not isinstance(contents, str):
            contents = contents.encode('utf-8')
        exec(contents, exec_globals, exec_locals)  # pylint: disable=exec-used
        return exec_locals['__version__']
669413
def init_opdata(l, from_mod, version=None, is_pypy=False):
    

    if version:
        l['python_version'] = version
    l['is_pypy'] = is_pypy
    l['cmp_op'] = cmp_op
    l['HAVE_ARGUMENT'] = HAVE_ARGUMENT
    if version <= 3.5:
        l['findlinestarts'] = findlinestarts
        l['findlabels']     = findlabels
        l['get_jump_targets'] = get_jump_targets
        l['get_jump_target_maps']  = get_jump_target_maps
    else:
        l['findlinestarts'] = wordcode.findlinestarts
        l['findlabels']     = wordcode.findlabels
        l['get_jump_targets'] = wordcode.get_jump_targets
        l['get_jump_target_maps']  = wordcode.get_jump_target_maps

    l['opmap'] = deepcopy(from_mod.opmap)
    l['opname'] = deepcopy(from_mod.opname)

    for field in fields2copy:
        l[field] = list(getattr(from_mod, field))
1257422
async function updateInfoPlist (version) {
  const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'mac', 'Info.plist')
  const file = plist.parse(await readFile(filePath, { encoding: 'utf8' }))

  file.CFBundleVersion = version
  file.CFBundleShortVersionString = version

  await writeFile(filePath, plist.build(file))
}