INNER CODE UNIT · Python
get_github_version
rfc-st/humble · humble.py:284
def get_github_version():
"""Fetch the date of the latest `humble` version from GitHub.
??? tip
`requests` is lazy-loaded to avoid unnecessary overhead.
"""
import requests
github_response = requests.get(URL_LIST[3], timeout=REQ_TIMEOUT)
github_response.raise_for_status()
github_repo = github_response.text
if (github_match := re.search(RE_PATTERN[4], github_repo)) is None:
print_error_detail("[update_error]")
return date.fromisoformat(github_match.group())
def check_updates(local_version):
"""Check for updated versions of `humble` on GitHub.