Make fetch python downloads deterministic (#11572)

Closes #11549
This commit is contained in:
Jo 2025-02-17 22:36:38 +08:00 committed by GitHub
parent 248da23f6d
commit 0498b9fb1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -203,7 +203,7 @@
"minor": 14,
"patch": 0,
"prerelease": "a5",
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.14.0a5%2B20250212-i686-pc-windows-msvc-shared-install_only_stripped.tar.gz",
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.14.0a5%2B20250212-i686-pc-windows-msvc-install_only_stripped.tar.gz",
"sha256": "5851a9e6a6afa698fa3ee5b678dff96e612f47e5e2c2f0c032f7c48d42f6a1ac",
"variant": null
},

View file

@ -244,6 +244,8 @@ class CPythonFinder(Finder):
if not rows:
break
for row in rows:
# Sort the assets to ensure deterministic results
row["assets"].sort(key=lambda asset: asset["browser_download_url"])
for asset in row["assets"]:
url = asset["browser_download_url"]
download = self._parse_download_url(url)

View file

@ -239,7 +239,7 @@ pub(crate) const PYTHON_DOWNLOADS: &[ManagedPythonDownload] = &[
libc: Libc::None,
variant: PythonVariant::Default
},
url: "https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.14.0a5%2B20250212-i686-pc-windows-msvc-shared-install_only_stripped.tar.gz",
url: "https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.14.0a5%2B20250212-i686-pc-windows-msvc-install_only_stripped.tar.gz",
sha256: Some("5851a9e6a6afa698fa3ee5b678dff96e612f47e5e2c2f0c032f7c48d42f6a1ac")
},
ManagedPythonDownload {