Skip to content

Instantly share code, notes, and snippets.

@phlax
Created May 19, 2021 14:54
Show Gist options
  • Save phlax/93d0e4e38c431a7e7cb8e988b89b2329 to your computer and use it in GitHub Desktop.
Save phlax/93d0e4e38c431a7e7cb8e988b89b2329 to your computer and use it in GitHub Desktop.
# Obtain latest release version and compare against metadata version, warn on
# mismatch.
def verify_and_print_latest_release(dep, repo, metadata_version, release_date):
try:
latest_release = repo.get_latest_release()
except github.GithubException as e:
# add a warning and make use of `e`
return
if latest_release.created_at > release_date and latest_release.tag_name != metadata_version:
print(
Fore.YELLOW
f'*WARNING* {dep} has a newer release than {metadata_version}@<{release_date}>: '
f'{latest_release.tag_name}@<{latest_release.created_at}>'
Style.RESET_ALL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment