Giter Club home page Giter Club logo

autoversion's People

Contributors

acabarbaye avatar alexl0gan avatar alf239 avatar davidhyman avatar dependabot-preview[bot] avatar dependabot[bot] avatar monty-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autoversion's Issues

Failing tests in CI preventing release

Describe the bug
@davidhyman : All PRs were merged to master. Nonetheless, Tests are failing in CI preventing any new release.

To Reproduce
#!/bin/bash -eo pipefail
git config user.email "[email protected]"
git config user.name "Your Name"
pipenv run pytest --junitxml=test-reports/results.xml
pipenv run green -r src

============================= test session starts ==============================
platform linux -- Python 3.7.0, pytest-5.4.1, py-1.10.0, pluggy-0.13.1
rootdir: /home/circleci/repo
plugins: html-2.1.1, metadata-1.11.0, cov-2.8.1
collecting ... collected 58 items

src/auto_version/tests/test_autoversion.py FEFEFEFEFEFEFEFEFFEFE........ [ 32%]
.....FFFFFE............................. [100%]

==================================== ERRORS ====================================
__________________ ERROR at teardown of TestBumps.test_build ___________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_build>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
________________ ERROR at teardown of TestBumps.test_bump_major ________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_bump_major>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
________________ ERROR at teardown of TestBumps.test_bump_news _________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_bump_news>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
________________ ERROR at teardown of TestBumps.test_bump_patch ________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_bump_patch>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
_____________ ERROR at teardown of TestBumps.test_custom_field_set _____________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_custom_field_set>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
___________________ ERROR at teardown of TestBumps.test_dev ____________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_dev>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
________________ ERROR at teardown of TestBumps.test_end_to_end ________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_end_to_end>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
______ ERROR at teardown of TestBumps.test_increment_existing_prerelease _______

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_increment_existing_prerelease>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
_____________ ERROR at teardown of TestBumps.test_non_release_bump _____________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_non_release_bump>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
____________ ERROR at teardown of TestBumps.test_simple_config_bump ____________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_simple_config_bump>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
_________________ ERROR at teardown of TestVCSTags.test_to_tag _________________

cls = <class 'auto_version.tests.test_autoversion.TestVCSTags'>

@classmethod
def tearDownClass(cls):
  cls.call(set_to="19.99.0")

test_autoversion.py:233:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
----------------------------- Captured stderr call -----------------------------
fatal: tag 'release/4.5.6' already exists
=================================== FAILURES ===================================
_____________________________ TestBumps.test_build _____________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_build>

def test_build(self):
    # can't just tag a build onto something that's already a release version
  self.call(set_to="19.99.0+build.1")

test_autoversion.py:83:


set_to = '19.99.0+build.1', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build='build.1')

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
__________________________ TestBumps.test_bump_major ___________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_bump_major>

def test_bump_major(self):
  old, new, updates = self.call(bump="major", release=True)

test_autoversion.py:47:


set_to = None, commit_count_as = None, release = True, bump = 'major'
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = {'major', 'patch'}
new_version = Version(major=20, minor=0, patch=0, prerelease=None, build=None)
overrides = {}

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
___________________________ TestBumps.test_bump_news ___________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_bump_news>

def test_bump_news(self):
  old, new, updates = self.call(enable_file_triggers=True, release=True)

test_autoversion.py:59:


set_to = None, commit_count_as = None, release = True, bump = None, lock = None
enable_file_triggers = True, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = {'minor', 'patch'}
new_version = Version(major=19, minor=100, patch=0, prerelease=None, build=None)
overrides = {}

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
__________________________ TestBumps.test_bump_patch ___________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_bump_patch>

def test_bump_patch(self):
  old, new, updates = self.call(bump="patch", release=True)

test_autoversion.py:35:


set_to = None, commit_count_as = None, release = True, bump = 'patch'
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = {'patch'}
new_version = Version(major=19, minor=99, patch=1, prerelease=None, build=None)
overrides = {}

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
_______________________ TestBumps.test_custom_field_set ________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_custom_field_set>

def test_custom_field_set(self):
  old, new, updates = self.call(UNRELATED_STRING="apple")

test_autoversion.py:128:


set_to = None, commit_count_as = None, release = None, bump = None, lock = None
enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {'UNRELATED_STRING': 'apple'}, all_data = {}
last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
______________________________ TestBumps.test_dev ______________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_dev>

def test_dev(self):
  old, new, updates = self.call(bump="prerelease")

test_autoversion.py:71:


set_to = None, commit_count_as = None, release = None, bump = 'prerelease'
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = {'patch', 'prerelease'}
new_version = Version(major=19, minor=99, patch=1, prerelease='dev.1', build=None)
overrides = {}

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
__________________________ TestBumps.test_end_to_end ___________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_end_to_end>

def test_end_to_end(self):
  self.call(bump="major")

test_autoversion.py:116:


set_to = None, commit_count_as = None, release = None, bump = 'major'
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = {'major', 'patch'}
new_version = Version(major=20, minor=0, patch=0, prerelease='dev.1', build=None)
overrides = {}

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
_________________ TestBumps.test_increment_existing_prerelease _________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_increment_existing_prerelease>

def test_increment_existing_prerelease(self):
  old, new, updates = self.call(set_to="1.2.3-RC.1")

test_autoversion.py:110:


set_to = '1.2.3-RC.1', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=1, minor=2, patch=3, prerelease='RC.1', build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
_________________________ TestBumps.test_invalid_bump __________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_invalid_bump>

def tearDown(self):
  self.call(set_to="19.99.0")

test_autoversion.py:32:


set_to = '19.99.0', commit_count_as = None, release = None, bump = None
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = set()
new_version = Version(major=19, minor=99, patch=0, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
_______________________ TestBumps.test_non_release_bump ________________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_non_release_bump>

def test_non_release_bump(self):
  old, new, updates = self.call(bump="minor")

test_autoversion.py:95:


set_to = None, commit_count_as = None, release = None, bump = 'minor'
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = {'minor', 'patch'}
new_version = Version(major=19, minor=100, patch=0, prerelease='dev.1', build=None)
overrides = {}

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
______________________ TestBumps.test_simple_config_bump _______________________

self = <auto_version.tests.test_autoversion.TestBumps testMethod=test_simple_config_bump>

def test_simple_config_bump(self):
  old, new, updates = self.call(config_path="simple.toml", bump="minor")

test_autoversion.py:122:


set_to = None, commit_count_as = None, release = None, bump = 'minor'
lock = None, enable_file_triggers = None, incr_from_release = None
config_path = 'simple.toml', persist_from = ['source'], persist_to = ['source']
dry_run = None, extra_updates = {}, all_data = {}, last_release_semver = None
current_semver = Version(major=19, minor=99, patch=0, prerelease=None, build=None)
release_commit = None, triggers = {'minor', 'patch'}
new_version = Version(major=19, minor=100, patch=0, prerelease='dev.1', build=None)
overrides = {}

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
____________________ TestVCSTags.test_from_ancestor_release ____________________

self = <auto_version.tests.test_autoversion.TestVCSTags testMethod=test_from_ancestor_release>

def test_from_ancestor_release(self):
    bumped = "4.5.6"
    old, new, updates = self.call(
      persist_from=[Constants.FROM_VCS_PREVIOUS_RELEASE]
    )

test_autoversion.py:266:


set_to = None, commit_count_as = None, release = None, bump = None, lock = None
enable_file_triggers = None, incr_from_release = None
config_path = 'example.toml', persist_from = ['vcs-prev-release']
persist_to = ['source'], dry_run = None, extra_updates = {}, all_data = {}
last_release_semver = None
current_semver = Version(major=4, minor=5, patch=6, prerelease=None, build=None)
release_commit = 'c510bed844bb936f99582e40e60413340e5876ab', triggers = set()
new_version = Version(major=4, minor=5, patch=6, prerelease=None, build=None)

def main(
    set_to=None,
    commit_count_as=None,
    release=None,
    bump=None,
    lock=None,
    enable_file_triggers=None,
    incr_from_release=None,
    config_path=None,
    persist_from=None,
    persist_to=None,
    dry_run=None,
    **extra_updates
):
    """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 commit_count_as: uses the commit count for the specified sigfig
    :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 enable_file_triggers: whether to enable bumping based on file triggers
                bumping occurs once if any file(s) exist that match the config
    :param incr_from_release: dynamically generates the bump by comparing the
                proposed triggers for the current version, with the significance of the previous release
                to ensure e.g. adding new major changes to a prerelease should probably trigger a new major version
                specifically, the bump is:
                if (max trigger sigfig) > (max sigfig since release):
                    (max trigger sigfig)
                else
                    (min trigger sigfig)
    :param config_path: path to config file
    :param extra_updates:
    :return:
    """
    updates = {}
    persist_to = persist_to or [Constants.TO_SOURCE]
    persist_from = persist_from or [Constants.FROM_SOURCE]
    load_config(config_path)

    all_data = {}
    last_release_semver = None
    if incr_from_release:
        if (Constants.FROM_VCS_PREVIOUS_VERSION in persist_from) or (
            Constants.FROM_VCS_PREVIOUS_RELEASE in persist_from
        ):
            last_release_semver = get_dvcs_previous_release_semver()
        else:
            last_release_semver = get_dvcs_repo_latest_release_semver()
    _LOG.debug("found previous full release: %s", last_release_semver)
    current_semver = get_current_version(persist_from)
    release_commit = get_dvcs_commit_for_version(current_semver, persist_from)
    triggers = get_all_triggers(bump, enable_file_triggers, release_commit)
    updates.update(get_lock_behaviour(triggers, all_data, lock))
    updates.update(get_dvcs_info())

    new_version = current_semver
    if set_to:
        _LOG.debug("setting version directly: %s", set_to)
        # parse it - validation failure will raise a ValueError
        new_version = semver.parse_version_info(set_to)
        if not lock:
            warnings.warn(
                "After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?",
                UserWarning,
            )
    elif triggers:
        # use triggers if the version is not set directly
        _LOG.debug("auto-incrementing version (triggers: %s)", triggers)
        overrides = get_overrides(updates, commit_count_as)
        new_version = utils.make_new_semver(
            current_semver, last_release_semver, triggers, **overrides
        )

    release_string = semver.finalize_version(str(new_version))
    release_version = semver.parse_version_info(release_string)
    if release:
        new_version = release_version
        updates[Constants.RELEASE_FIELD] = config.RELEASED_VALUE
        updates[Constants.VERSION_FIELD] = release_string
        updates[Constants.VERSION_STRICT_FIELD] = release_string
    else:
        updates[Constants.VERSION_FIELD] = str(new_version)
        updates[Constants.VERSION_STRICT_FIELD] = release_string

    # write out the individual parts of the version
  updates.update(new_version._asdict())

E AttributeError: 'Version' object has no attribute '_asdict'

../auto_version_tool.py:478: AttributeError
____________________ TestVCSTags.test_from_ancestor_version ____________________

self = <auto_version.tests.test_autoversion.TestVCSTags testMethod=test_from_ancestor_version>

def setUp(self):
    cmd = "git tag release/4.5.6"
  subprocess.check_call(shlex.split(cmd))

test_autoversion.py:237:


popenargs = (['git', 'tag', 'release/4.5.6'],), kwargs = {}, retcode = 128
cmd = ['git', 'tag', 'release/4.5.6']

def check_call(*popenargs, **kwargs):
    """Run command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    """
    retcode = call(*popenargs, **kwargs)
    if retcode:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
      raise CalledProcessError(retcode, cmd)

E subprocess.CalledProcessError: Command '['git', 'tag', 'release/4.5.6']' returned non-zero exit status 128.

/usr/local/lib/python3.7/subprocess.py:328: CalledProcessError
----------------------------- Captured stderr call -----------------------------
fatal: tag 'release/4.5.6' already exists
___________________ TestVCSTags.test_from_latest_of_all_time ___________________

self = <auto_version.tests.test_autoversion.TestVCSTags testMethod=test_from_latest_of_all_time>

def setUp(self):
    cmd = "git tag release/4.5.6"
  subprocess.check_call(shlex.split(cmd))

test_autoversion.py:237:


popenargs = (['git', 'tag', 'release/4.5.6'],), kwargs = {}, retcode = 128
cmd = ['git', 'tag', 'release/4.5.6']

def check_call(*popenargs, **kwargs):
    """Run command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    """
    retcode = call(*popenargs, **kwargs)
    if retcode:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
      raise CalledProcessError(retcode, cmd)

E subprocess.CalledProcessError: Command '['git', 'tag', 'release/4.5.6']' returned non-zero exit status 128.

/usr/local/lib/python3.7/subprocess.py:328: CalledProcessError
----------------------------- Captured stderr call -----------------------------
fatal: tag 'release/4.5.6' already exists
_______________ TestVCSTags.test_from_latest_of_all_time_release _______________

self = <auto_version.tests.test_autoversion.TestVCSTags testMethod=test_from_latest_of_all_time_release>

def setUp(self):
    cmd = "git tag release/4.5.6"
  subprocess.check_call(shlex.split(cmd))

test_autoversion.py:237:


popenargs = (['git', 'tag', 'release/4.5.6'],), kwargs = {}, retcode = 128
cmd = ['git', 'tag', 'release/4.5.6']

def check_call(*popenargs, **kwargs):
    """Run command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    """
    retcode = call(*popenargs, **kwargs)
    if retcode:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
      raise CalledProcessError(retcode, cmd)

E subprocess.CalledProcessError: Command '['git', 'tag', 'release/4.5.6']' returned non-zero exit status 128.

/usr/local/lib/python3.7/subprocess.py:328: CalledProcessError
----------------------------- Captured stderr call -----------------------------
fatal: tag 'release/4.5.6' already exists
___________________________ TestVCSTags.test_to_tag ____________________________

self = <auto_version.tests.test_autoversion.TestVCSTags testMethod=test_to_tag>

def setUp(self):
    cmd = "git tag release/4.5.6"
  subprocess.check_call(shlex.split(cmd))

test_autoversion.py:237:


popenargs = (['git', 'tag', 'release/4.5.6'],), kwargs = {}, retcode = 128
cmd = ['git', 'tag', 'release/4.5.6']

def check_call(*popenargs, **kwargs):
    """Run command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    """
    retcode = call(*popenargs, **kwargs)
    if retcode:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
      raise CalledProcessError(retcode, cmd)

E subprocess.CalledProcessError: Command '['git', 'tag', 'release/4.5.6']' returned non-zero exit status 128.

/usr/local/lib/python3.7/subprocess.py:328: CalledProcessError
----------------------------- Captured stderr call -----------------------------
fatal: tag 'release/4.5.6' already exists
=============================== warnings summary ===============================
.venv/lib/python3.7/site-packages/_pytest/junitxml.py:417
/home/circleci/repo/.venv/lib/python3.7/site-packages/_pytest/junitxml.py:417: PytestDeprecationWarning: The 'junit_family' default value will change to 'xunit2' in pytest 6.0.
Add 'junit_family=xunit1' to your pytest.ini file to keep the current format in future versions of pytest and silence this warning.
_issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)

src/auto_version/tests/test_autoversion.py:3
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:3: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp

src/auto_version/tests/test_autoversion.py: 47 tests with warnings
/home/circleci/repo/src/auto_version/utils.py:19: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
return semver.parse_version_info(text)

src/auto_version/tests/test_autoversion.py: 45 tests with warnings
/home/circleci/repo/src/auto_version/utils.py:50: DeprecationWarning: Function 'semver.finalize_version' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use the respective 'semver.Version.finalize_version' instead.
release_versions = {semver.finalize_version(version) for version in versions}

src/auto_version/tests/test_autoversion.py: 23 tests with warnings
/home/circleci/repo/src/auto_version/utils.py:66: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
return semver.parse_version_info(result)

src/auto_version/tests/test_autoversion.py: 14 tests with warnings
/home/circleci/repo/src/auto_version/auto_version_tool.py:452: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
new_version = semver.parse_version_info(set_to)

src/auto_version/tests/test_autoversion.py: 14 tests with warnings
/home/circleci/repo/src/auto_version/auto_version_tool.py:456: UserWarning: After setting version manually, does it need locking for a CI flow, to avoid an extraneous increment?
UserWarning,

src/auto_version/tests/test_autoversion.py: 23 tests with warnings
/home/circleci/repo/src/auto_version/auto_version_tool.py:466: DeprecationWarning: Function 'semver.finalize_version' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use the respective 'semver.Version.finalize_version' instead.
release_string = semver.finalize_version(str(new_version))

src/auto_version/tests/test_autoversion.py: 23 tests with warnings
/home/circleci/repo/src/auto_version/auto_version_tool.py:467: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
release_version = semver.parse_version_info(release_string)

src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_major
src/auto_version/tests/test_autoversion.py::TestBumps::test_end_to_end
/home/circleci/repo/src/auto_version/utils.py:150: DeprecationWarning: Function 'semver.bump_major' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use the respective 'semver.Version.bump_major' instead.
str(current_semver), **get_token_args(bump_sigfig)

src/auto_version/tests/test_autoversion.py: 11 tests with warnings
/home/circleci/repo/src/auto_version/utils.py:158: DeprecationWarning: Function 'semver.bump_prerelease' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use the respective 'semver.Version.bump_prerelease' instead.
version_string, token=config.PRERELEASE_TOKEN

src/auto_version/tests/test_autoversion.py: 14 tests with warnings
/home/circleci/repo/src/auto_version/utils.py:162: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
version_info = semver.parse_version_info(version_string)

src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_news
src/auto_version/tests/test_autoversion.py::TestBumps::test_non_release_bump
src/auto_version/tests/test_autoversion.py::TestBumps::test_simple_config_bump
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_more
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_release_bump
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_release_bump_with_history
/home/circleci/repo/src/auto_version/utils.py:150: DeprecationWarning: Function 'semver.bump_minor' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use the respective 'semver.Version.bump_minor' instead.
str(current_semver), **get_token_args(bump_sigfig)

src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_patch
src/auto_version/tests/test_autoversion.py::TestBumps::test_dev
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_no_history_bump
/home/circleci/repo/src/auto_version/utils.py:150: DeprecationWarning: Function 'semver.bump_patch' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use the respective 'semver.Version.bump_patch' instead.
str(current_semver), **get_token_args(bump_sigfig)

src/auto_version/tests/test_autoversion.py::TestUtils::test_is_release
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:134: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
self.assertTrue(utils.is_release(semver.parse_version_info("1.2.3")))

src/auto_version/tests/test_autoversion.py::TestUtils::test_is_release
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:135: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
self.assertFalse(utils.is_release(semver.parse_version_info("1.2.3-RC.1")))

src/auto_version/tests/test_autoversion.py::TestUtils::test_is_release
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:136: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
self.assertFalse(utils.is_release(semver.parse_version_info("1.2.3+abc")))

src/auto_version/tests/test_autoversion.py::TestUtils::test_semver_diff
src/auto_version/tests/test_autoversion.py::TestUtils::test_semver_diff
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:158: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
semver.parse_version_info("1.2.3"), semver.parse_version_info("1.3.5")

src/auto_version/tests/test_autoversion.py::TestUtils::test_semver_diff
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:164: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
semver.parse_version_info("1.2.3"),

src/auto_version/tests/test_autoversion.py::TestUtils::test_semver_diff
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:165: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
semver.parse_version_info("1.2.4-RC.1"),

src/auto_version/tests/test_autoversion.py::TestUtils::test_semver_diff
src/auto_version/tests/test_autoversion.py::TestUtils::test_semver_diff
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:171: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
semver.parse_version_info("1.2.3"), semver.parse_version_info("1.2.3")

src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_less
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_more
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_same
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_release_bump_with_history
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:185: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
previous = semver.parse_version_info(previous) if previous else None

src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_less
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_more
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_same
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_no_history_bump
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_no_history_pre_bump
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_release_bump
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_release_bump_with_history
/home/circleci/repo/src/auto_version/tests/test_autoversion.py:190: DeprecationWarning: Function 'semver.parse_version_info' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use 'semver.Version.parse' instead.
semver.parse_version_info(current), previous, bumps

src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_less
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_candidate_bump_with_history_same
src/auto_version/tests/test_autoversion.py::TestNewSemVerLogic::test_no_history_pre_bump
/home/circleci/repo/src/auto_version/utils.py:150: DeprecationWarning: Function 'semver.bump_prerelease' is deprecated. Deprecated since version 2.10.0. This function will be removed in semver 3. Use the respective 'semver.Version.bump_prerelease' instead.
str(current_semver), **get_token_args(bump_sigfig)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
------- generated xml file: /home/circleci/repo/test-reports/results.xml -------
=========================== short test summary info ============================
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_build - At...
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_major
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_news
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_patch
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_custom_field_set
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_dev - Attr...
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_end_to_end
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_increment_existing_prerelease
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_invalid_bump
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_non_release_bump
FAILED src/auto_version/tests/test_autoversion.py::TestBumps::test_simple_config_bump
FAILED src/auto_version/tests/test_autoversion.py::TestVCSTags::test_from_ancestor_release
FAILED src/auto_version/tests/test_autoversion.py::TestVCSTags::test_from_ancestor_version
FAILED src/auto_version/tests/test_autoversion.py::TestVCSTags::test_from_latest_of_all_time
FAILED src/auto_version/tests/test_autoversion.py::TestVCSTags::test_from_latest_of_all_time_release
FAILED src/auto_version/tests/test_autoversion.py::TestVCSTags::test_to_tag
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_build - Att...
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_major
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_news
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_bump_patch
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_custom_field_set
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_dev - Attri...
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_end_to_end
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_increment_existing_prerelease
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_non_release_bump
ERROR src/auto_version/tests/test_autoversion.py::TestBumps::test_simple_config_bump
ERROR src/auto_version/tests/test_autoversion.py::TestVCSTags::test_to_tag - ...
============ 16 failed, 42 passed, 250 warnings, 11 errors in 2.97s ============

Exited with code exit status 1

CircleCI received exit code 1

XML regex

XML would be a useful to have as a default pattern

It's identical to *.csproj

IOError: [Errno 2] No such file or directory: 'src/_version.py'

pip install pyautoversion
auto_version
/lib/python2.7/site-packages/auto_version/auto_version_tool.py", line 93, in read_targets
    with open(target) as fh:
IOError: [Errno 2] No such file or directory: 'src/_version.py'

It would seem the _version.py file does not exist

edit:
This is where the target project doesn't have that file. Ideally this failure would not occur. Perhaps the default config should not contain any targets at all.

the API does not return the correct new version (autoversion 2.0.0)

old, new, updates = auto_version_tool.main(
release=True, enable_file_triggers=True, bump=None, config_path="...",
)
new always contains the prerelease suffix although it should be the new version and in this case, should be the production release.
For Python, it should be the same as updates["__version__"] but it isn't

CI does not test install

#̶7̶ ̶c̶o̶u̶l̶d̶ ̶h̶a̶v̶e̶ ̶b̶e̶e̶n̶ ̶d̶e̶t̶e̶c̶t̶e̶d̶ ̶a̶t̶ ̶C̶I̶ ̶t̶i̶m̶e̶

The project build & test could be:

  • checkout
  • build wheel file
  • pip install from wheel file
  • run tests

edit: my bad, this is just first startup because the default config doesn't like an uninitialised project. CI improvement is probably still valid though.

Javascript - Incorrect matching on npm scripts with colons in name

Autoversion is matching on scripts with colons in the title.

"clean:build": "rimraf ./lib ./bundles ./types" matches as "clean:build".

This is causing autoversion to mangle the package.json.

Before

{
  "name": "mbed-cloud-sdk",
  "version": "2.0.1",
  "is_published": true,
  "is_locked": false,
  "description": "Mbed Cloud SDK for JavaScript",
  "homepage": "https://www.mbed.com",
  "author": "Rob Moran <[email protected]>",
  "license": "Apache-2.0",
  "types": "./types/index.d.ts",
  "main": "./index.js",
  "files": [
    "bundles",
    "lib",
    "examples"
  ],
  "browser": {
    "./index.js": "./bundles/index.min.js"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/ARMmbed/mbed-cloud-sdk-javascript.git"
  },
  "keywords": [
    "Mbed",
    "SDK"
  ],
  "engines": {
    "node": ">=6.0.0"
  },
  "scripts": {
    "build": "npm-run-all --parallel clean:build lint:fix --sequential compile",
    "clean": "npm-run-all --parallel clean:**",
    "clean:build": "rimraf ./lib ./bundles ./types",
    "clean:coverage": "rimraf ./coverage",
    "clean:docs": "rimraf ./docs/docs",
    "clean:integration": "rimraf test/integration/build",
    "compile": "npm-run-all compile:node compile:browser",
    "compile:node": "tsc --declaration --declarationDir 'types'",
    "compile:browser": "gulp",
    "compile:integration": "tsc -p integration.tsconfig.json",
    "docs": "npm-run-all clean:docs docs:build",
    "docs:build": "typedoc --options typedoc.json ./src/**/*.ts",
    "generate": "npm-run-all generate:** lint:fix compile:node",
    "generate:run": "node generator/build.js",
    "generate:format": "prettier --write --tab-width 4 --print-width 120 --trailing-comma es5 './src/sdk/generated/**/**/*.ts' './src/sdk/generated/*.ts'",
    "integration": "npm-run-all clean:integration compile:integration integration:run",
    "integration:run": "node test/integration/build/test/integration/codeCoverage.js",
    "lint": "tslint -c tslint.json 'src/**/**/*.ts'",
    "lint:fix": "tslint --fix -c tslint.json 'src/**/**/*.ts'",
    "start-proxy": "node examples/proxy/server.js",
    "test": "jest --projects test/unit/configs/node*.js --runInBand",
    "test:snippets": "jest --projects test/unit/configs/snippets*.js",
    "test:man": "jest --projects test/unit/configs/man*.js",
    "watch": "jest --watch",
    "watch:integration": "npm-run-all clean:integration watch:integration:start",
    "watch:integration:start": "tsc-watch -p integration.tsconfig.json --onSuccess \"node test/integration/build/test/integration/codeCoverage.js\"",
    "tpip": "node scripts/generate-tpip.js"
  },
  "devDependencies": {
    "@types/express": "^4.0.37",
    "@types/jest": "^23.3.3",
    "@types/memory-cache": "^0.2.0",
    "@types/node": "^7.0.67",
    "@types/superagent": "^2.0.36",
    "body-parser": "^1.18.2",
    "browserify": "^14.0.0",
    "csv-write-stream": "2.0.0",
    "ejs": "^2.6.1",
    "express": "^4.14.1",
    "fs-extra": "^7.0.0",
    "glob": "^7.1.3",
    "gulp": "^3.9.1",
    "gulp-buffer": "0.0.2",
    "gulp-sourcemaps": "^2.4.0",
    "gulp-tap": "^0.1.3",
    "gulp-uglify": "^2.0.1",
    "istanbul-lib-coverage": "^2.0.1",
    "istanbul-lib-hook": "^2.0.1",
    "istanbul-lib-instrument": "^2.3.2",
    "istanbul-lib-source-maps": "^2.0.1",
    "jest": "^23.6.0",
    "memory-cache": "^0.2.0",
    "nlf": "^2.0.0",
    "npm-run-all": "^4.1.3",
    "nyc": "^11.3.0",
    "prettier": "^1.14.3",
    "rimraf": "^2.6.2",
    "ts-jest": "^23.10.3",
    "tsc-watch": "^1.0.26",
    "tslint": "^5.11.0",
    "tslint-eslint-rules": "^5.4.0",
    "typedoc": "^0.11.1",
    "typescript": "^3.1.1",
    "typescript-logging": "^0.5.0"
  },
  "dependencies": {
    "dotenv": "^6.0.0",
    "superagent": "^3.4.1"
  }
}

After

{
  "name": "mbed-cloud-sdk",
  "version": "2.0.1-dev.660",
  "is_published": true,
  "is_locked": false,
  "description": "Mbed Cloud SDK for JavaScript",
  "homepage": "https://www.mbed.com",
  "author": "Rob Moran <[email protected]>",
  "license": "Apache-2.0",
  "types": "./types/index.d.ts",
  "main": "./index.js",
  "files": [
    "bundles",
    "lib",
    "examples"
  ],
  "browser": {
    "./index.js": "./bundles/index.min.js"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/ARMmbed/mbed-cloud-sdk-javascript.git"
  },
  "keywords": [
    "Mbed",
    "SDK"
  ],
  "engines": {
    "node": ">=6.0.0"
  },
  "scripts": {
    "build": "npm-run-all --parallel clean:build lint:fix --sequential compile",
    "clean": "npm-run-all --parallel clean:**",
    "clean:build": "rimraf ./lib ./bundles ./types",: "rimraf ./lib ./bundles ./types",
    "clean:coverage": "rimraf ./coverage",: "rimraf ./coverage",
    "clean:docs": "rimraf ./docs/docs",: "rimraf ./docs/docs",
    "clean:integration": "rimraf test/integration/build",: "rimraf test/integration/build",
    "compile": "npm-run-all compile:node compile:browser",
    "compile:node": "tsc --declaration --declarationDir 'types'",: "tsc --declaration --declarationDir 'types'",
    "compile:browser": "gulp",: "gulp",
    "compile:integration": "tsc -p integration.tsconfig.json",: "tsc -p integration.tsconfig.json",
    "docs": "npm-run-all clean:docs docs:build",
    "docs:build": "typedoc --options typedoc.json ./src/**/*.ts",: "typedoc --options typedoc.json ./src/**/*.ts",
    "generate": "npm-run-all generate:** lint:fix compile:node",
    "generate:run": "node generator/build.js",: "node generator/build.js",
    "generate:format": "prettier --write --tab-width 4 --print-width 120 --trailing-comma es5 './src/sdk/generated/**/**/*.ts' './src/sdk/generated/*.ts'",: "prettier --write --tab-width 4 --print-width 120 --trailing-comma es5 './src/sdk/generated/**/**/*.ts' './src/sdk/generated/*.ts'",
    "integration": "npm-run-all clean:integration compile:integration integration:run",
    "integration:run": "node test/integration/build/test/integration/codeCoverage.js",: "node test/integration/build/test/integration/codeCoverage.js",
    "lint": "tslint -c tslint.json 'src/**/**/*.ts'",'src/**/**/*.ts'",
    "lint:fix": "tslint --fix -c tslint.json 'src/**/**/*.ts'",: "tslint --fix -c tslint.json 'src/**/**/*.ts'",
    "start-proxy": "node examples/proxy/server.js",
    "test": "jest --projects test/unit/configs/node*.js --runInBand",
    "test:snippets": "jest --projects test/unit/configs/snippets*.js",: "jest --projects test/unit/configs/snippets*.js",
    "test:man": "jest --projects test/unit/configs/man*.js",: "jest --projects test/unit/configs/man*.js",
    "watch": "jest --watch",
    "watch:integration": "npm-run-all clean:integration watch:integration:start",: "npm-run-all clean:integration watch:integration:start",
    "watch:integration:start": "tsc-watch -p integration.tsconfig.json --onSuccess \"node test/integration/build/test/integration/codeCoverage.js\"",: "tsc-watch -p integration.tsconfig.json --onSuccess \"node test/integration/build/test/integration/codeCoverage.js\"",
    "tpip": "node scripts/generate-tpip.js"
  },
  "devDependencies": {
    "@types/express": "^4.0.37",
    "@types/jest": "^23.3.3",
    "@types/memory-cache": "^0.2.0",
    "@types/node": "^7.0.67",
    "@types/superagent": "^2.0.36",
    "body-parser": "^1.18.2",
    "browserify": "^14.0.0",
    "csv-write-stream": "2.0.0",
    "ejs": "^2.6.1",
    "express": "^4.14.1",
    "fs-extra": "^7.0.0",
    "glob": "^7.1.3",
    "gulp": "^3.9.1",
    "gulp-buffer": "0.0.2",
    "gulp-sourcemaps": "^2.4.0",
    "gulp-tap": "^0.1.3",
    "gulp-uglify": "^2.0.1",
    "istanbul-lib-coverage": "^2.0.1",
    "istanbul-lib-hook": "^2.0.1",
    "istanbul-lib-instrument": "^2.3.2",
    "istanbul-lib-source-maps": "^2.0.1",
    "jest": "^23.6.0",
    "memory-cache": "^0.2.0",
    "nlf": "^2.0.0",
    "npm-run-all": "^4.1.3",
    "nyc": "^11.3.0",
    "prettier": "^1.14.3",
    "rimraf": "^2.6.2",
    "ts-jest": "^23.10.3",
    "tsc-watch": "^1.0.26",
    "tslint": "^5.11.0",
    "tslint-eslint-rules": "^5.4.0",
    "typedoc": "^0.11.1",
    "typescript": "^3.1.1",
    "typescript-logging": "^0.5.0"
  },
  "dependencies": {
    "dotenv": "^6.0.0",
    "superagent": "^3.4.1"
  }
}

prerelease increment should be modified

Let's consider the following scenario:

  • initial version 1.0.0
  • first prerelease contains some major changes -> 2.0.0-pre.1
  • a production release is performed and contains one major change from the prerelease:
    current tool would make the version be 3.0.0 but we would expect 2.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.