Run bumpversion.main() with the specified arguments, and return the
        new computed version string.
506943
def bumpversion(self, part, commit=True, tag=False, message=None,
                    allow_dirty=False):
        
        import bumpversion

        args = (
            (['--verbose'] if self.verbose > 1 else []) +
            (['--allow-dirty'] if allow_dirty else []) +
            (['--commit'] if commit else ['--no-commit']) +
            (['--tag'] if tag else ['--no-tag']) +
            (['--message', message] if message is not None else []) +
            ['--list', part]
        )
        log.debug(
            "$ bumpversion %s" % " ".join(a.replace(" ", "\\ ") for a in args))

        with capture_logger("bumpversion.list") as out:
            bumpversion.main(args)

        last_line = out.getvalue().splitlines()[-1]
        new_version = last_line.replace("new_version=", "")
        return new_version
945154
def add_version_func(self, show_version):
        '''  '''
        if callable(show_version):
            self.__show_version_func = show_version
        else:
            self.__show_version_func = lambda cli, args: print(show_version)
        self.parser.add_argument("-V", "--version", action="store_true")
739257
function (inputVersion, outputVersion) {
        var converter;

        inputVersion = semver.clean(inputVersion);
        outputVersion = semver.clean(outputVersion);

        for (converter in this.converters) {
            // eslint-disable-next-line no-prototype-builtins
            converter = this.converters.hasOwnProperty(converter) && this.converters[converter];
            if (converter && semver.eq(converter.input, inputVersion) && semver.eq(converter.output, outputVersion)) {
                return generateConverter(converter);
            }
        }
    }
793029
def main(argv=None):
    ''''''
    
    program_name = os.path.basename(sys.argv[0])
    program_version = "v0.1"
    program_build_date = "%s" % __updated__
 
    program_version_string = '%%prog %s (%s)' % (program_version, program_build_date)
    #program_usage = '''usage: spam two eggs''' # optional - will be autogenerated by optparse
    program_longdesc = '''''' # optional - give further explanation about what the program does
    program_license = "Copyright 2013 Renaud Dussurget"
 
    if argv is None:
        argv = sys.argv[1:]
    try:
        # setup option parser
        parser = OptionParser(version=program_version_string, epilog=program_longdesc, description=program_license)
        parser.add_option("-v", "--verbose", dest="verbose", action="store", type="int", help="set verbosity level [default: %default]",default=0)
        parser.add_option("-l", "--use_local_dims", dest="use_local_dims", action="store_true", help="Use local netcdf dimensions [default: %default]",default=True)
        parser.add_option("-O", "--overwrite", dest="overwrite", action="store_true", help="Overwrite output file [default: %default]",default=False)
        parser.add_option("-f", "--format", dest="format", action="store", help="Output NetCDF format [default: %default]",default="NETCDF4")

        
        #Add kwargs!
        kwargs_keys=[]
        for a in argv :
            if a.startswith('--'):
                parser.add_option(a,dest=a.replace('--',''),action="store", help="Additional keyword to use with nctools [default: %default]")
#                parser.set_defaults(**{a.replace('--',''):False})
                kwargs_keys.append(a.replace('--',''))

        # set defaults
#        parser.set_defaults(verbose="4",use_local_dims="True")
        
        # process options
        (opts, args) = parser.parse_args(argv)
        
        if opts.verbose > 0:
            print("verbosity level = %d" % opts.verbose)
            
        if len(args) != 3 :
            raise Exception('Program needs 3 arguments') 
            
        # MAIN BODY #
        
    except Exception, e:
        indent = len(program_name) * " "
        sys.stderr.write(program_name + ": " + repr(e) + "\n")
        sys.stderr.write(indent + "  for help use --help")
        return 2

    #Get program arguments
    f1=args[0]
    f2=args[1]
    fout=args[2]
    
    #Get keyword arguments for nc
    kwargs={}
    for k in kwargs_keys :
        kwargs.update({k:eval(opts.__dict__.get(k))})
    
    ncr=nc(verbose=opts.verbose,use_local_dims=opts.use_local_dims)
    
    d1=ncr.load(f1,**kwargs)
    d2=ncr.load(f2,**kwargs)
    
    dout=d1.copy()
    for k in d2.keys():
        dout.update({k:d2.get(k)})
    
    attrStr=dout.get('_attributes',{})
    
    cmd=[os.path.basename(sys.argv[0])]
    for a in argv : cmd.append(a)
    attrStr.update({'history':attrStr.pop('history','') +' '.join(cmd)})
    dout.update({'_attributes':attrStr})
    ncr.write(dout,fout,clobber=opts.overwrite,format=opts.format)
1051667
function (version, cmd, args) {
        return __awaiter(this, void 0, void 0, function* () {
            let binpath = yield getBinPath(version);
            let parentEnv = process.env;
            let childPath = binpath + path.delimiter + parentEnv.PATH;
            let env = Object.assign({}, parentEnv, { PATH: childPath });
            let spawnOpts = { cwd: process.cwd(), env: env };
            return Promise.resolve(child_process_1.spawn(cmd, args, spawnOpts));
        });
    }
637293
def _add_version_info(func):
		
		pattern = r'v(?P<source>\d+)_to_(?P<target>\d+)$'
		match = re.match(pattern, func.__name__)
		if not match:
			raise ValueError("migration function name must match " + pattern)
		func.source, func.target = map(int, match.groups())
906022
function createBumpVersion(inPath, type) {
    if (!inPath) {
        throw new Error('Input path(s) argument is required');
    }

    return function bumpVersion() {
        return gulp.src(inPath)
            .pipe(bump({ type }))
            .pipe(gulp.dest(file => file.base));
    };
}
213587
function cmpVersion(a, b) {
    "use strict";
    var i, cmp, len, re = /(\.0)+[^\.]*$/;
    function versionToString(version) {
        if (isObject(version)) {
            try {
                return [version.major, version.minor, version.patch].join('.');
            } catch (e) {}
        }
        return version;
    }
    a = versionToString(a);
    b = versionToString(b);
    a = (a + '').replace(re, '').split('.');
    b = (b + '').replace(re, '').split('.');
    len = Math.min(a.length, b.length);
    for (i = 0; i < len; i++) {
        cmp = parseInt(a[i], 10) - parseInt(b[i], 10);
        if (cmp !== 0) {
            return cmp;
        }
    }
    return a.length - b.length;
}
834686
def get_cli():
    """"""
    parser = argparse.ArgumentParser(
        prog="auto_version",
        description="auto version v%s: a tool to control version numbers" % __version__,
    )
    parser.add_argument(
        "--target",
        action="append",
        default=[],
        help="Files containing version info. "
        "Assumes unique variable names between files. (default: %s)."
        % (config.targets,),
    )
    parser.add_argument(
        "--bump",
        choices=SemVerSigFig,
        help="Bumps the specified part of SemVer string. "
        "Use this locally to correctly modify the version file.",
    )
    parser.add_argument(
        "--news",
        "--file-triggers",
        action="store_true",
        dest="file_triggers",
        help="Detects need to bump based on presence of files (as specified in config).",
    )
    parser.add_argument(
        "--set",
        help="Set the SemVer string. Use this locally to set the project version explicitly.",
    )
    parser.add_argument(
        "--set-patch-count",
        action="store_true",
        help="Sets the patch number to the commit count.",
    )
    parser.add_argument(
        "--lock",
        action="store_true",
        help="Locks the SemVer string. "
        "Lock will remain for another call to autoversion before being cleared.",
    )
    parser.add_argument(
        "--release",
        action="store_true",
        default=False,
        help="Marks as a release build, which flags the build as released.",
    )
    parser.add_argument(
        "--version",
        action="store_true",
        default=False,
        help="Prints the version of auto_version itself (self-version).",
    )
    parser.add_argument("--config", help="Configuration file path.")
    parser.add_argument(
        "-v",
        "--verbosity",
        action="count",
        default=0,
        help="increase output verbosity. " "can be specified multiple times",
    )
    return parser.parse_known_args()
135662
def run_version(args: dict) -> int:
    """"""
    version = environ.package_settings.get('version', 'unknown')
    print('VERSION: {}'.format(version))
    return 0
412364
async function run() {
  try {
    // Find last release: Get tags, filter out wrong tags and pre-releases, then take last one.
    const { stdout } = // get last filtered tag, sorted by version numbers in ascending order
      await exec(`git tag | grep '${tagFrom}' | grep -Ev '-' | sort -V | tail -1`);
    const prevTag = stdout.trim();
    const nextVersion = parseVersion(argv[releaseNameParam]);

    // Normalize the given "release-name" for the tile (strip out pre-release information).
    const nextVersionString = `v${nextVersion.major}.${nextVersion.sub}.${nextVersion.minor}`;

    // Read previous changelog to extend it (remove ending line feeds -> added back in later)
    const changelogContent = fs.readFileSync('CHANGELOG.md', { encoding: 'utf8' }).trimRight();

    const config = lernaConfiguration.load();

    // This causes the "Unreleased" title to be replaced by a version that links to a github diff.
    config.nextVersion = `[${
      nextVersionString
    }](https://github.com/shopgate/pwa/compare/${prevTag}...${nextVersionString})`;

    // Skip creation if the "nextVersion" title is already present.
    if (changelogContent.includes(config.nextVersion)) {
      // Output the already existing data when already is there already.
      logger.log(changelogContent);
      return;
    }

    const changelog = new Changelog(config);

    // The "release-name" param is not supposed to be used here. Instead use "HEAD".
    const latestChanges = await changelog.createMarkdown({
      tagFrom: prevTag,
      tagTo,
    });

    // Add changes to the top of the main changelog
    let newChangelog = '# Changelog\n';
    if (appendPreviousChangelog) {
      newChangelog = changelogContent;
    }
    if (latestChanges.trim().length > 0) {
      newChangelog = newChangelog.replace(
        '# Changelog\n',
        `# Changelog\n\n${latestChanges.trim()}\n`
      );
      if (tagTo !== 'HEAD') {
        newChangelog = newChangelog.replace(
          `## ${tagTo} `,
          `## ${config.nextVersion} `
        );
      }
    }

    // Print the output for the bash/makefile to read
    logger.log(newChangelog);
  } catch (error) {
    throw error;
  }
}
1329864
def run(self):
        
        with open('src/gvar/__init__.py', 'a') as gvfile:
            gvfile.write("\n__version__ = '%s'\n" % GVAR_VERSION)
        _build_py.run(self)
767729
def bump_version(version, bump='patch'):
    """"""
    try:
        parts = map(int, version.split('.'))
    except ValueError:
        fail('Current version is not numeric')

    if bump == 'patch':
        parts[2] += 1
    elif bump == 'minor':
        parts[1] += 1
        parts[2] = 0
    elif bump == 'major':
        parts[0] +=1
        parts[1] = 0
        parts[2] = 0

    return '.'.join(map(str, parts))
662079
def get_main_version(version):
    ""
    parts = 2 if version[2] == 0 else 3
    return '.'.join(str(x) for x in version[:parts])
674519
def version(**kwargs):
    
    retry = kwargs.get("retry")
    if retry:
        click.echo('Retrying publication of the same version...')
    else:
        click.echo('Creating new version..')

    try:
        current_version = get_current_version()
    except GitError as e:
        click.echo(click.style(str(e), 'red'), err=True)
        return False

    click.echo('Current version: {0}'.format(current_version))
    level_bump = evaluate_version_bump(current_version, kwargs['force_level'])
    new_version = get_new_version(current_version, level_bump)

    if new_version == current_version and not retry:
        click.echo(click.style('No release will be made.', fg='yellow'))
        return False

    if kwargs['noop'] is True:
        click.echo('{0} Should have bumped from {1} to {2}.'.format(
            click.style('No operation mode.', fg='yellow'),
            current_version,
            new_version
        ))
        return False

    if config.getboolean('semantic_release', 'check_build_status'):
        click.echo('Checking build status..')
        owner, name = get_repository_owner_and_name()
        if not check_build_status(owner, name, get_current_head_hash()):
            click.echo(click.style('The build has failed', 'red'))
            return False
        click.echo(click.style('The build was a success, continuing the release', 'green'))

    if retry:
        # No need to make changes to the repo, we're just retrying.
        return True

    if config.get('semantic_release', 'version_source') == 'commit':
        set_new_version(new_version)
        commit_new_version(new_version)
    tag_new_version(new_version)
    click.echo('Bumping with a {0} version to {1}.'.format(level_bump, new_version))
    return True
1176870
def handle_addVersion(repo, **kwargs):
    """"""
    log.info('addVersion: %s %s' %(repo, kwargs))
    try:
        v = repo.addVersion(**kwargs)
        return v.serialize()
    except RepoError, e:
        raise
981926
def version():
    '''
    
    '''
    cmd = ['znc', '--version']
    out = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
    ret = out[0].split(' - ')
    return ret[0]