in src/prepare_dlc_dev_environment.py [0:0]
def handle_currency_option(currency_paths):
"""
Handle the --new_currency option by creating new buildspec files with incremented minor versions
and updating the TOML file with the information from the new buildspec file paths.
"""
buildspec_pattern = (
r"^(\w+)/(training|inference)/buildspec(?:-(\w+))?-(\d+)-(\d+)(?:-(.+))?\.yml$"
)
for currency_path in currency_paths:
if not validate_currency_path(currency_path):
continue
(
framework,
job_type,
optional_tag,
major_version,
minor_version,
extra_tag,
) = extract_path_components(currency_path, buildspec_pattern)
latest_version_path = find_latest_version_path(
framework, job_type, optional_tag, major_version, extra_tag
)
if latest_version_path:
updated_content = generate_new_file_content(
latest_version_path, major_version, minor_version
)
create_new_file_with_updated_version(
currency_path, updated_content, latest_version_path
)
else:
LOGGER.warning(f"No previous version found for {currency_path}")
return framework, job_type