This commit is contained in:
Loup-Garou911XD 2025-12-10 19:38:03 +05:30
parent 80c6a673e5
commit 9ff775e2f1
5 changed files with 17 additions and 12 deletions

View file

@ -1,24 +0,0 @@
import re
import sys
def get_version_changelog(version: str):
"""Get changelog entry from CHANGELOG.md for given version"""
with open('CHANGELOG.md', 'r') as file:
content = file.read()
pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)"
matches = re.findall(pattern, content, re.DOTALL)
if matches:
return matches[0].strip()
else:
return f"Changelog entry for version {version} not found."
if __name__ == "__main__":
if len(sys.argv) < 2:
print(f"Usage: python3 {__file__.split('/')[-1]} version_number")
sys.exit(1)
version = sys.argv[1].replace("v", "", 1)
changelog = get_version_changelog(version)
print(changelog)