def _calculate_source_version():
    global _calculated_version

    if _calculated_version is None:
        try:
            head_commit_hash = _get_commit_hash_from_revision_param('HEAD')
            head_commit_is_on_trunk = _is_commit_hash_in_masters_first_parent_chain(head_commit_hash)

            commit_count = _get_repo_commit_count()
            hash_extension = '' if head_commit_is_on_trunk else '-{}'.format(head_commit_hash[:7])
            mod_extension = '' if not _repo_has_uncommited_changes() else '-mod'
            _calculated_version = '{}.{}{}{}'.format(_MAJOR_MINOR_VERSION, commit_count, hash_extension, mod_extension)

        except subprocess.CalledProcessError:
            _calculated_version = '{}.???'.format(_MAJOR_MINOR_VERSION)

    return _calculated_version
Calculate the version using a scheme based off of git repo info. Note that since this depends on the git history,
dataset/ETHPy150Open box/ClusterRunner/app/util/autoversioning.py/_calculate_source_version