def main(<EOL>set_to=None,<EOL>set_patch_count=None,<EOL>release=None,<EOL>bump=None,<EOL>lock=None,<EOL>file_triggers=None,<EOL>config_path=None,<EOL>**extra_updates<EOL>):
updates = {}<EOL>if config_path:<EOL><INDENT>get_or_create_config(config_path, config)<EOL><DEDENT>for k, v in config.regexers.items():<EOL><INDENT>config.regexers[k] = re.compile(v)<EOL><DEDENT>for k, v in config.key_aliases.items():<EOL><INDENT>config._forward_aliases[v] = k<EOL><DEDENT>all_data = read_targets(config.targets)<EOL>current_semver = semver.get_current_semver(all_data)<EOL>triggers = get_all_triggers(bump, file_triggers)<EOL>updates.update(get_lock_behaviour(triggers, all_data, lock))<EOL>updates.update(get_dvcs_info())<EOL>if set_to:<EOL><INDENT>_LOG.debug("<STR_LIT>", set_to)<EOL>new_semver = auto_version.definitions.SemVer(*set_to.split("<STR_LIT:.>"))<EOL>if not lock:<EOL><INDENT>warnings.warn(<EOL>"<STR_LIT>",<EOL>UserWarning,<EOL>)<EOL><DEDENT><DEDENT>elif set_patch_count:<EOL><INDENT>_LOG.debug(<EOL>"<STR_LIT>",<EOL>updates[Constants.COMMIT_COUNT_FIELD],<EOL>)<EOL>new_semver = semver.make_new_semver(<EOL>current_semver, triggers, patch=updates[Constants.COMMIT_COUNT_FIELD]<EOL>)<EOL><DEDENT>else:<EOL><INDENT>_LOG.debug("<STR_LIT>")<EOL>new_semver = semver.make_new_semver(current_semver, triggers)<EOL><DEDENT>updates.update(<EOL>get_final_version_string(<EOL>release_mode=release,<EOL>semver=new_semver,<EOL>commit_count=updates.get(Constants.COMMIT_COUNT_FIELD, <NUM_LIT:0>),<EOL>)<EOL>)<EOL>for part in semver.SemVerSigFig:<EOL><INDENT>updates[part] = getattr(new_semver, part)<EOL><DEDENT>native_updates = {<EOL>native: updates[key]<EOL>for native, key in config.key_aliases.items()<EOL>if key in updates<EOL>}<EOL>native_updates.update(extra_updates)<EOL>write_targets(config.targets, **native_updates)<EOL>return current_semver, new_semver, native_updates<EOL>
Main workflow.

    Load config from cli and file
    Detect "bump triggers" - things that cause a version increment
    Find the current version
    Create a new version
    Write out new version and any other requested variables

    :param set_to: explicitly set semver to this version string
    :param set_patch_count: sets the patch number to the commit count
    :param release: marks with a production flag
                just sets a single flag as per config
    :param bump: string indicating major/minor/patch
                more significant bumps will zero the less significant ones
    :param lock: locks the version string for the next call to autoversion
                lock only removed if a version bump would have occurred
    :param file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param config_path: path to config file
    :param extra_updates:
    :return: