chore: Delete obsolete script

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2348>
environments/review-docs-docs-ox2r7i/deployments/18559
Georg Krause 2023-11-01 13:15:14 +00:00 zatwierdzone przez Marge
rodzic fe47420ba1
commit 73364145c3
1 zmienionych plików z 0 dodań i 58 usunięć

Wyświetl plik

@ -1,58 +0,0 @@
#!/usr/bin/env python3
import argparse
import json
import subprocess
from distutils.version import StrictVersion
def get_versions():
output = subprocess.check_output(
["git", "tag", "-l", "--format=%(creatordate:iso-strict)|%(refname:short)"]
)
tags = []
for line in output.decode().splitlines():
try:
date, tag = line.split("|")
except ValueError:
continue
if not date or not tag:
continue
tags.append({"id": tag, "date": date})
valid = []
for tag in tags:
try:
StrictVersion(tag["id"])
valid.append(tag)
except ValueError:
continue
return sorted(valid, key=lambda tag: StrictVersion(tag["id"]), reverse=True)
def main(latest=False):
versions = get_versions()
if latest:
print(versions[0]["id"])
else:
data = {"count": len(versions), "releases": versions}
print(json.dumps(data, sort_keys=True, indent=2))
if __name__ == "__main__":
parser = argparse.ArgumentParser(
"""
Compile release data and output in in JSON format
"""
)
parser.add_argument(
"-l",
"--latest",
action="store_true",
help="Only print the latest version then exit",
)
args = parser.parse_args()
main(latest=args.latest)