diff --git a/.github/verify_versions.py b/.github/verify_versions.py index 4da2ea1..1801e21 100644 --- a/.github/verify_versions.py +++ b/.github/verify_versions.py @@ -8,11 +8,11 @@ def verify_all_mod_versions(): manifesto = json.load(f) for mod in manifesto: - print('Verifying "{}":'.format(mod)) + print(f'Verifying "{mod}":') # Build GitHub API link and fetch distant tags list words = manifesto[mod]['Repository'].split('/') - tags_url = "https://api.github.com/repos/{}/{}/tags".format(words[-2], words[-1]) + tags_url = f"https://api.github.com/repos/{words[-2]}/{words[-1]}/tags" response = urlopen(tags_url) tags_data = json.loads(response.read()) @@ -23,14 +23,14 @@ def verify_all_mod_versions(): # There should be only one matching version if len(matching_distant_versions) != 1: - sys.exit(' ❌ v{} (unknown distant version)'.format(version['Version'])) + sys.exit(f' ❌ v{version["Version"]} (unknown distant version)') # Compare manifesto commit hash with repository hash distant_version = matching_distant_versions[0] if local_hash == distant_version['commit']['sha']: - print(' ✔️ v{}'.format(version['Version'])) + print(f' ✔️ v{version['Version']}') else: - sys.exit(' ❌ v{} (hash comparison failed)'.format(version['Version'])) + sys.exit(f' ❌ v{version['Version']} (hash comparison failed)') if __name__ == "__main__": verify_all_mod_versions()