From 8a935a924ad886bb102dc4bad7acf24bb54d279b Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 4 Apr 2022 16:13:10 -0300 Subject: [PATCH] [arch.version] refactoring: String formatting method --- CHANGELOG.md | 5 +++++ bauh/gems/arch/version.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ef7c58d..ed6f93aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.10.2] +### Improvements +- General + - code refactoring + ### Fixes - Debian - info: crashing when the package size has unexpected symbols [#251](https://github.com/vinifmor/bauh/issues/251) + ## [0.10.1] 2022-03-31 ### Features diff --git a/bauh/gems/arch/version.py b/bauh/gems/arch/version.py index 1f55cc9c..53cd5b24 100644 --- a/bauh/gems/arch/version.py +++ b/bauh/gems/arch/version.py @@ -10,10 +10,10 @@ def normalize_version(version: str) -> LegacyVersion: final_version = version.strip() if not RE_VERSION_WITH_EPOCH.match(final_version): - final_version = '0:{}'.format(final_version) + final_version = f'0:{final_version}' if not RE_VERSION_WITH_RELEASE.match(final_version): - final_version = '{}-1'.format(final_version) + final_version = f'{final_version}-1' return LegacyVersion(final_version) @@ -25,7 +25,7 @@ def match_required_version(current_version: str, operator: str, required_version current_has_epoch = len(current_no_epoch) > 1 if required_has_epoch and not current_has_epoch: - final_current = '0:{}'.format(final_current) + final_current = f'0:{final_current}' elif current_has_epoch and not required_has_epoch: final_current = current_no_epoch[1] @@ -33,7 +33,7 @@ def match_required_version(current_version: str, operator: str, required_version current_has_release = len(current_no_release) > 1 if required_has_release and not current_has_release: - final_current = '{}-1'.format(final_current) + final_current = f'{final_current}-1' elif current_has_release and not required_has_release: final_current = current_no_release[1]