๐Ÿ“ฆ astral-sh / rye

๐Ÿ“„ summarize-release.py ยท 26 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26import json
import os
import sys

version = sys.argv[1]
base = sys.argv[2]

checksums = {}

for folder in os.listdir(base):
    for filename in os.listdir(os.path.join(base, folder)):
        if filename.endswith(".sha256"):
            with open(os.path.join(base, folder, filename)) as f:
                sha256 = f.read().strip()
            checksums[filename[:-7]] = sha256

print(
    json.dumps(
        {
            "version": version,
            "checksums": checksums,
        },
        indent=2,
    )
)