11#
2- # Copyright (C) 2020 Arm. All rights reserved.
2+ # Copyright (C) 2020-2021 Arm. All rights reserved.
33# SPDX-License-Identifier: Apache-2.0
44#
55"""Handles usage of towncrier for automated changelog generation and pyautoversion for versioning."""
@@ -57,7 +57,7 @@ def _calculate_version(commit_type: CommitType, use_news_files: bool) -> Tuple[b
5757 new_version : Optional [str ] = None
5858 is_new_version : bool = False
5959 with cd (os .path .dirname (project_config_path )):
60- old , _ , updates = auto_version_tool .main (
60+ old , new_version , updates = auto_version_tool .main (
6161 release = is_release ,
6262 enable_file_triggers = enable_file_triggers ,
6363 commit_count_as = bump ,
@@ -66,7 +66,9 @@ def _calculate_version(commit_type: CommitType, use_news_files: bool) -> Tuple[b
6666 # Autoversion second returned value is not actually the new version
6767 # There seem to be a bug in autoversion.
6868 # This is why the following needs to be done to determine the version
69- new_version = updates ["__version__" ]
69+ for k , v in updates .items ():
70+ if "version" in str (k ).lower ():
71+ new_version = updates [k ]
7072 is_new_version = old != new_version
7173 logger .info (":: Determining the new version" )
7274 logger .info (f"Version: { new_version } " )
0 commit comments