Skip to content

Commit 0fe82c5

Browse files
authored
chore: order python-standalone releases for stability (#2456)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 0b6c7d0 commit 0fe82c5

File tree

2 files changed

+226
-226
lines changed

2 files changed

+226
-226
lines changed

bin/update_python_build_standalone.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ def main() -> None:
2525
f"repos/astral-sh/python-build-standalone/releases/tags/{latest_tag}"
2626
)["assets"]
2727

28-
assets: list[PythonBuildStandaloneAsset] = []
28+
assets = [
29+
PythonBuildStandaloneAsset(name=ga["name"], url=ga["browser_download_url"])
30+
for ga in github_assets
31+
if ga["name"].endswith("install_only.tar.gz")
32+
]
2933

30-
for github_asset in github_assets:
31-
name = github_asset["name"]
32-
if not name.endswith("install_only.tar.gz"):
33-
continue
34-
url = github_asset["browser_download_url"]
35-
assets.append({"name": name, "url": url})
34+
# Try to keep output order stable
35+
assets = sorted(assets, key=lambda x: x["name"])
3636

3737
# Write the assets to the JSON file. One day, we might need to support
3838
# multiple releases, but for now, we only support the latest one
39-
json_file_contents: PythonBuildStandaloneReleaseData = {
40-
"releases": [
39+
json_file_contents = PythonBuildStandaloneReleaseData(
40+
releases=[
4141
{
4242
"tag": latest_tag,
4343
"assets": assets,
4444
}
4545
]
46-
}
46+
)
4747

4848
with PYTHON_BUILD_STANDALONE_RELEASES.open("w", encoding="utf-8") as f:
4949
json.dump(json_file_contents, f, indent=2)

0 commit comments

Comments
 (0)