Skip to content

Commit

Permalink
remove semver
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaizzy committed Jul 16, 2024
1 parent c6bcbf6 commit 0a0831d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions update_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from datetime import datetime

import requests
import semver
from dotenv import load_dotenv

# Load environment variables
Expand All @@ -31,7 +30,6 @@
REPO_NAME = "fastmlx"
GITHUB_TOKEN = os.getenv("UPDATE_CHANGELOG_TOKEN")


# File paths
CHANGELOG_PATH = "docs/changelog.md"

Expand All @@ -49,8 +47,13 @@ def get_releases():


def parse_version(version_string):
"""Parse version string to semver object, handling 'v' prefix."""
return semver.VersionInfo.parse(version_string.lstrip("v"))
"""Parse version string to tuple, handling 'v' prefix."""
return tuple(map(int, version_string.lstrip("v").split(".")))


def compare_versions(v1, v2):
"""Compare two version tuples."""
return (v1 > v2) - (v1 < v2)


def create_issue_link(issue_number):
Expand Down Expand Up @@ -101,7 +104,6 @@ def format_release_notes(body):
cleaned_line = cleaned_line.replace("* ", "- ")
formatted_notes.append(cleaned_line)
else:

formatted_notes.append(line)

# Replace issue numbers with clickable links
Expand Down Expand Up @@ -135,7 +137,7 @@ def update_changelog(releases):
if version in existing_versions:
continue

print(f"Adding new version: {version}") # Debug print
print(f"Adding new version: {'.'.join(map(str, version))}") # Debug print

release_date = datetime.strptime(
release["published_at"], "%Y-%m-%dT%H:%M:%SZ"
Expand Down

0 comments on commit 0a0831d

Please sign in to comment.