def get_latest_version_from_changelog() -> str:
    """Get the most recently listed version from the changelog."""
    with open(ROOT_DIR / HISTORY_FILE, encoding='utf8') as f:
        for line in f:
            match = re.match(HISTORY_RELEASE_HEAD_REGEX, line)
            if match:
                return match.group(1)
    raise ValueError('Latest version not found in changelog')
Get the most recently listed version from the changelog.
release/push.py