From 9983273289ba229c20c3008b831a06c685497b29 Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Mon, 21 Jul 2025 20:35:45 +0800 Subject: [PATCH] Use sha256 checksum from GitHub API for GraalPy releases (#14779) ## Summary Follow #14078, use GitHub generated sha256 for GraalPy releases too. ## Test Plan ```console uv run ./crates/uv-python/fetch-download-metadata.py ``` --- crates/uv-python/fetch-download-metadata.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/uv-python/fetch-download-metadata.py b/crates/uv-python/fetch-download-metadata.py index f43349e50..ec2b4835e 100755 --- a/crates/uv-python/fetch-download-metadata.py +++ b/crates/uv-python/fetch-download-metadata.py @@ -607,6 +607,9 @@ class GraalPyFinder(Finder): platform = self._normalize_os(m.group(1)) arch = self._normalize_arch(m.group(2)) libc = "gnu" if platform == "linux" else "none" + sha256 = None + if digest := asset["digest"]: + sha256 = digest.removeprefix("sha256:") download = PythonDownload( release=0, version=python_version, @@ -619,6 +622,7 @@ class GraalPyFinder(Finder): implementation=self.implementation, filename=asset["name"], url=url, + sha256=sha256, ) # Only keep the latest GraalPy version of each arch/platform if (python_version, arch, platform) not in results: @@ -633,6 +637,7 @@ class GraalPyFinder(Finder): return self.PLATFORM_MAPPING.get(os, os) async def _fetch_checksums(self, downloads: list[PythonDownload], n: int) -> None: + downloads = list(filter(lambda d: not d.sha256, downloads)) for idx, batch in enumerate(batched(downloads, n)): logging.info("Fetching GraalPy checksums: %d/%d", idx * n, len(downloads)) checksum_requests = []