From 36300bab3f61b84e19f32b6bd26b7897f3c7e951 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Wed, 2 Dec 2026 11:40:15 +0100 Subject: [PATCH] Respect the mirror setting when selecting the version manifest (#1164) Select the manifest source from the action inputs and keep version resolution separate from archive downloads. Fetch the built-in manifest directly from GitHub when the Astral mirror is disabled. Fixes: #1140 Based on the work of @Rudra-G-23 in https://github.com/astral-sh/setup-uv/pull/1152 Co-authored-by: Amp --- README.md | 2 +- __tests__/download/download-version.test.ts | 337 +-- .../download/intrinsic-checksums.test.ts | 3 +- __tests__/download/manifest.test.ts | 168 +- __tests__/helpers/setup-inputs.ts | 5 + __tests__/utils/inputs.test.ts | 36 +- action.yml | 2 +- dist/save-cache/index.cjs | 29 +- dist/setup/index.cjs | 2239 +++++++++-------- dist/update-known-checksums/index.cjs | 164 +- docs/customization.md | 3 +- src/download/download-version.ts | 47 +- src/download/manifest.ts | 120 +- src/setup-uv.ts | 41 +- src/update-known-checksums.ts | 7 +- src/utils/constants.ts | 4 - src/utils/inputs.ts | 40 +- src/version/resolve.ts | 36 +- src/version/types.ts | 1 - 19 files changed, 1637 insertions(+), 1647 deletions(-) diff --git a/README.md b/README.md index 86bfd6f..66a4e7b 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed # URL to a custom manifest file in the astral-sh/versions format manifest-file: "" - # Download uv from the Astral mirror instead of directly from GitHub Releases + # Use the Astral mirror for the default version manifest and uv release archives download-from-astral-mirror: "true" # Add problem matchers diff --git a/__tests__/download/download-version.test.ts b/__tests__/download/download-version.test.ts index c158882..1133890 100644 --- a/__tests__/download/download-version.test.ts +++ b/__tests__/download/download-version.test.ts @@ -1,6 +1,12 @@ import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import * as semver from "semver"; -import { VERSIONS_MANIFEST_URL } from "../../src/utils/constants"; +import type { ManifestSource } from "../../src/utils/inputs"; + +const customManifest: ManifestSource = { + custom: true, + newestFirst: false, + url: "https://example.com/custom.ndjson", +}; const mockInfo = jest.fn(); const mockWarning = jest.fn(); @@ -38,14 +44,11 @@ const mockGetLatestVersion = jest.fn(); const mockGetAllVersions = jest.fn(); // biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. const mockGetFirstMatchingVersion = jest.fn(); -// biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockGetArtifact = jest.fn(); jest.unstable_mockModule("../../src/download/manifest", () => ({ getAllVersions: mockGetAllVersions, - getArtifact: mockGetArtifact, getFirstMatchingVersion: mockGetFirstMatchingVersion, - getLatestVersion: mockGetLatestVersion, + getFirstVersion: mockGetLatestVersion, })); // biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. @@ -61,9 +64,11 @@ jest.unstable_mockModule("../../src/download/checksum/known-version", () => ({ getLatestKnownVersion: mockGetLatestKnownVersion, })); -const { downloadVersion, resolveVersion, rewriteToMirror } = await import( +const { downloadVersion, rewriteToMirror } = await import( "../../src/download/download-version" ); +const { resolveVersion } = await import("../../src/version/resolve"); +const { ASTRAL_MANIFEST } = await import("../../src/utils/inputs"); describe("download-version", () => { beforeEach(() => { @@ -76,7 +81,6 @@ describe("download-version", () => { mockGetLatestVersion.mockReset(); mockGetAllVersions.mockReset(); mockGetFirstMatchingVersion.mockReset(); - mockGetArtifact.mockReset(); mockValidateChecksum.mockReset(); mockGetLatestKnownVersion.mockClear(); @@ -90,15 +94,15 @@ describe("download-version", () => { it("uses the default manifest to resolve latest", async () => { mockGetLatestVersion.mockResolvedValue("0.9.26"); - const version = await resolveVersion("latest", undefined); + const version = await resolveVersion("latest", ASTRAL_MANIFEST); expect(version).toBe("0.9.26"); expect(mockGetLatestVersion).toHaveBeenCalledTimes(1); - expect(mockGetLatestVersion).toHaveBeenCalledWith(undefined); + expect(mockGetLatestVersion).toHaveBeenCalledWith(ASTRAL_MANIFEST); }); it("resolves latest-known without reading the manifest", async () => { - const version = await resolveVersion("latest-known", undefined); + const version = await resolveVersion("latest-known", ASTRAL_MANIFEST); expect(version).toBe("0.9.25"); expect(mockGetLatestKnownVersion).toHaveBeenCalledTimes(1); @@ -113,23 +117,31 @@ describe("download-version", () => { ["0.9.26", "0.9.25"].find(predicate), ); - const version = await resolveVersion("^0.9.0", undefined); + const version = await resolveVersion("^0.9.0", ASTRAL_MANIFEST); expect(version).toBe("0.9.26"); expect(mockGetFirstMatchingVersion).toHaveBeenCalledTimes(1); expect(mockGetAllVersions).not.toHaveBeenCalled(); }); - it("streams ranges when the default manifest URL is explicit", async () => { + it("uses the ordered search for the direct GitHub manifest", async () => { mockGetFirstMatchingVersion.mockImplementation( (predicate: (version: string) => boolean) => ["0.9.26", "0.9.25"].find(predicate), ); + const source: ManifestSource = { + custom: false, + newestFirst: true, + url: "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson", + }; - const version = await resolveVersion("^0.9.0", VERSIONS_MANIFEST_URL); + const version = await resolveVersion("^0.9.0", source); expect(version).toBe("0.9.26"); - expect(mockGetFirstMatchingVersion).toHaveBeenCalledTimes(1); + expect(mockGetFirstMatchingVersion).toHaveBeenCalledWith( + expect.any(Function), + source, + ); expect(mockGetAllVersions).not.toHaveBeenCalled(); }); @@ -139,7 +151,7 @@ describe("download-version", () => { ["0.9.26", "0.9.25"].find(predicate), ); - const version = await resolveVersion("!=0.9.26", undefined); + const version = await resolveVersion("!=0.9.26", ASTRAL_MANIFEST); expect(version).toBe("0.9.25"); expect(mockGetFirstMatchingVersion).toHaveBeenCalledTimes(1); @@ -152,18 +164,15 @@ describe("download-version", () => { ["1.0.0", "0.10.2", "0.9.26"].find(predicate), ); - const version = await resolveVersion("~=0.9", undefined); + const version = await resolveVersion("~=0.9", ASTRAL_MANIFEST); expect(version).toBe("0.10.2"); }); it("resolves ~= with PEP 440 compatible release semantics from manifest-file", async () => { - mockGetAllVersions.mockResolvedValue(["1.0.0", "0.10.2", "0.9.26"]); + mockGetAllVersions.mockResolvedValue(["0.9.26", "1.0.0", "0.10.2"]); - const version = await resolveVersion( - "~=0.9", - "https://example.com/custom.ndjson", - ); + const version = await resolveVersion("~=0.9", customManifest); expect(version).toBe("0.10.2"); }); @@ -177,7 +186,7 @@ describe("download-version", () => { ["0.10.2", "0.9.26", "0.9.0", "0.8.24"].find(predicate), ); - const version = await resolveVersion(specifier, undefined); + const version = await resolveVersion(specifier, ASTRAL_MANIFEST); expect(version).toBe(expected); }); @@ -190,13 +199,13 @@ describe("download-version", () => { "0.9.0", ]); - const version = await resolveVersion(">0.9", undefined, "lowest"); + const version = await resolveVersion(">0.9", ASTRAL_MANIFEST, "lowest"); expect(version).toBe("0.9.1"); }); it("treats == exact pins as explicit versions", async () => { - const version = await resolveVersion("==0.9.26", undefined); + const version = await resolveVersion("==0.9.26", ASTRAL_MANIFEST); expect(version).toBe("0.9.26"); expect(mockGetAllVersions).not.toHaveBeenCalled(); @@ -206,93 +215,82 @@ describe("download-version", () => { it("uses latest for minimum-only ranges when using the highest strategy", async () => { mockGetLatestVersion.mockResolvedValue("0.9.26"); - const version = await resolveVersion(">=0.9.0", undefined, "highest"); + const version = await resolveVersion( + ">=0.9.0", + ASTRAL_MANIFEST, + "highest", + ); expect(version).toBe("0.9.26"); expect(mockGetLatestVersion).toHaveBeenCalledTimes(1); - expect(mockGetLatestVersion).toHaveBeenCalledWith(undefined); + expect(mockGetLatestVersion).toHaveBeenCalledWith(ASTRAL_MANIFEST); expect(mockGetAllVersions).not.toHaveBeenCalled(); }); it("uses the lowest compatible version when requested", async () => { mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]); - const version = await resolveVersion("^0.9.0", undefined, "lowest"); + const version = await resolveVersion("^0.9.0", ASTRAL_MANIFEST, "lowest"); expect(version).toBe("0.9.25"); expect(mockGetAllVersions).toHaveBeenCalledTimes(1); - expect(mockGetAllVersions).toHaveBeenCalledWith(undefined); + expect(mockGetAllVersions).toHaveBeenCalledWith(ASTRAL_MANIFEST); }); - it("uses manifest-file when provided", async () => { - mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]); + it.each(["latest", ">=0.9.0"])( + "uses the first custom manifest record for %s", + async (specifier) => { + mockGetLatestVersion.mockResolvedValue("0.9.7"); + mockGetAllVersions.mockResolvedValue(["0.9.7", "0.9.26"]); - const version = await resolveVersion( - "^0.9.0", - "https://example.com/custom.ndjson", + await expect(resolveVersion(specifier, customManifest)).resolves.toBe( + "0.9.7", + ); + }, + ); + + it("rejects the first custom manifest record if it does not meet the minimum", async () => { + mockGetLatestVersion.mockResolvedValue("0.9.7"); + mockGetAllVersions.mockResolvedValue(["0.9.7", "0.9.26"]); + + await expect(resolveVersion(">=0.9.8", customManifest)).rejects.toThrow( + "No version found for >=0.9.8", ); + }); - expect(version).toBe("0.9.26"); - expect(mockGetAllVersions).toHaveBeenCalledWith( - "https://example.com/custom.ndjson", + it("resolves a range from an unordered custom manifest", async () => { + mockGetAllVersions.mockResolvedValue(["0.9.7", "0.9.26", "0.9.25"]); + + await expect(resolveVersion("^0.9.0", customManifest)).resolves.toBe( + "0.9.26", ); }); }); describe("downloadVersion", () => { - it("fails when manifest lookup fails", async () => { - mockGetArtifact.mockRejectedValue(new Error("manifest unavailable")); + const githubUrl = + "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz"; + const mirrorUrl = + "https://releases.astral.sh/github/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz"; + const customUrl = "https://example.com/uv.tar.gz"; - await expect( - downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - ), - ).rejects.toThrow("manifest unavailable"); - - expect(mockDownloadTool).not.toHaveBeenCalled(); - expect(mockValidateChecksum).not.toHaveBeenCalled(); - }); - - it("fails when no matching artifact exists in the default manifest", async () => { - mockGetArtifact.mockResolvedValue(undefined); - - await expect( - downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - ), - ).rejects.toThrow( - "Could not find artifact for version 0.9.26, arch x86_64, platform unknown-linux-gnu in https://releases.astral.sh/github/versions/main/v1/uv.ndjson .", - ); - - expect(mockDownloadTool).not.toHaveBeenCalled(); - expect(mockValidateChecksum).not.toHaveBeenCalled(); - }); - - it("uses the default manifest checksum as a fallback", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "manifest-checksum", - downloadUrl: "https://example.com/uv.tar.gz", - }); - - await downloadVersion( + function install(downloadUrl: string, checksum?: string, useMirror = true) { + return downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", - undefined, + { checksum: "manifest-checksum", downloadUrl }, + checksum, "token", + useMirror, ); + } + + it("passes the explicit and fallback checksums to verification", async () => { + await install(customUrl, "user-checksum"); expect(mockValidateChecksum).toHaveBeenCalledWith( - undefined, + "user-checksum", "/tmp/downloaded", "x86_64", "unknown-linux-gnu", @@ -302,102 +300,44 @@ describe("download-version", () => { }); it("rewrites GitHub Releases URLs to the Astral mirror", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "abc123", - downloadUrl: - "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", - }); - - await downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - ); + await install(githubUrl); expect(mockDownloadTool).toHaveBeenCalledWith( - "https://releases.astral.sh/github/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", + mirrorUrl, undefined, undefined, ); }); - it("does not send the token to non-GitHub URLs from the default manifest", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "abc123", - downloadUrl: "https://example.com/uv.tar.gz", - }); - - await downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - ); - - expect(mockDownloadTool).toHaveBeenCalledWith( - "https://example.com/uv.tar.gz", - undefined, - undefined, - ); - }); - - it("does not send the token to GitHub lookalike hosts", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "abc123", - downloadUrl: "https://github.com.evil.test/uv.tar.gz", - }); - - await downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - ); - - expect(mockDownloadTool).toHaveBeenCalledWith( - "https://github.com.evil.test/uv.tar.gz", - undefined, - undefined, - ); - }); + it.each([customUrl, "https://github.com.evil.test/uv.tar.gz"])( + "does not send the token to %s", + async (url) => { + await install(url); + expect(mockDownloadTool).toHaveBeenCalledWith( + url, + undefined, + undefined, + ); + }, + ); it("falls back to GitHub Releases when the mirror fails", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "abc123", - downloadUrl: - "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", - }); - mockDownloadTool .mockRejectedValueOnce(new Error("mirror unavailable")) .mockResolvedValueOnce("/tmp/downloaded"); - await downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - ); + await install(githubUrl); expect(mockDownloadTool).toHaveBeenCalledTimes(2); expect(mockDownloadTool).toHaveBeenNthCalledWith( 1, - "https://releases.astral.sh/github/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", + mirrorUrl, undefined, undefined, ); expect(mockDownloadTool).toHaveBeenNthCalledWith( 2, - "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", + githubUrl, undefined, "token", ); @@ -407,99 +347,18 @@ describe("download-version", () => { }); it("does not fall back for non-GitHub URLs", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "abc123", - downloadUrl: "https://example.com/uv.tar.gz", - }); - mockDownloadTool.mockRejectedValue(new Error("download failed")); - await expect( - downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - ), - ).rejects.toThrow("download failed"); + await expect(install(customUrl)).rejects.toThrow("download failed"); expect(mockDownloadTool).toHaveBeenCalledTimes(1); }); - it("uses manifest-file checksum metadata when checksum input is unset", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "manifest-checksum", - downloadUrl: "https://example.com/custom-uv.tar.gz", - }); - - await downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - "", - "token", - "https://example.com/custom.ndjson", - ); - - expect(mockValidateChecksum).toHaveBeenCalledWith( - "manifest-checksum", - "/tmp/downloaded", - "x86_64", - "unknown-linux-gnu", - "0.9.26", - "manifest-checksum", - ); - }); - - it("prefers checksum input over manifest-file checksum metadata", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "manifest-checksum", - downloadUrl: "https://example.com/custom-uv.tar.gz", - }); - - await downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - "user-checksum", - "token", - "https://example.com/custom.ndjson", - ); - - expect(mockValidateChecksum).toHaveBeenCalledWith( - "user-checksum", - "/tmp/downloaded", - "x86_64", - "unknown-linux-gnu", - "0.9.26", - "manifest-checksum", - ); - }); - it("skips the Astral mirror when downloadFromAstralMirror is false", async () => { - mockGetArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "abc123", - downloadUrl: - "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", - }); - - await downloadVersion( - "unknown-linux-gnu", - "x86_64", - "0.9.26", - undefined, - "token", - undefined, - false, - ); + await install(githubUrl, undefined, false); expect(mockDownloadTool).toHaveBeenCalledWith( - "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", + githubUrl, undefined, "token", ); diff --git a/__tests__/download/intrinsic-checksums.test.ts b/__tests__/download/intrinsic-checksums.test.ts index 80597c0..9c1333d 100644 --- a/__tests__/download/intrinsic-checksums.test.ts +++ b/__tests__/download/intrinsic-checksums.test.ts @@ -79,7 +79,8 @@ test("enforces intrinsic checksums on downloads and tool-cache hits", async () = await expect(install(version, true, "0".repeat(64))).rejects.toMatchObject({ stdout: expect.stringContaining("did not match"), }); - // The custom manifest also offers these bytes under a known release version. + // The custom manifest checksum wins unless intrinsic checksums are required. + await install("0.9.26", false); await expect(install("0.9.26", true)).rejects.toMatchObject({ stdout: expect.stringContaining("did not match"), }); diff --git a/__tests__/download/manifest.test.ts b/__tests__/download/manifest.test.ts index 4d1db82..7ff255d 100644 --- a/__tests__/download/manifest.test.ts +++ b/__tests__/download/manifest.test.ts @@ -6,6 +6,7 @@ import { it, jest, } from "@jest/globals"; +import type { ManifestSource } from "../../src/utils/inputs"; // biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. const mockFetch = jest.fn(); @@ -19,6 +20,7 @@ jest.unstable_mockModule("../../src/utils/fetch", () => ({ fetch: mockFetch, })); +const { ASTRAL_MANIFEST } = await import("../../src/utils/inputs"); const { MANIFEST_FETCH_ATTEMPTS, clearManifestCache, @@ -26,10 +28,21 @@ const { getAllVersions, getArtifact, getFirstMatchingVersion, - getLatestVersion, + getFirstVersion, parseManifest, } = await import("../../src/download/manifest"); +const githubManifest: ManifestSource = { + custom: false, + newestFirst: true, + url: "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson", +}; +const customManifest: ManifestSource = { + custom: true, + newestFirst: false, + url: "https://example.com/custom.ndjson", +}; + const sampleManifestResponse = `{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f"},{"platform":"x86_64-pc-windows-msvc","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-pc-windows-msvc.zip","archive_format":"zip","sha256":"eb02fd95d8e0eed462b4a67ecdd320d865b38c560bffcda9a0b87ec944bdf036"}]} {"version":"0.9.25","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.25/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"606b3c6949d971709f2526fa0d9f0fd23ccf60e09f117999b406b424af18a6a6"}]}`; @@ -91,7 +104,7 @@ describe("manifest", () => { createMockResponse(true, 200, "OK", sampleManifestResponse), ); - const versions = await fetchManifest(); + const versions = await fetchManifest(ASTRAL_MANIFEST); expect(versions).toHaveLength(2); expect(versions[0]?.version).toBe("0.9.26"); @@ -111,7 +124,7 @@ describe("manifest", () => { createMockResponse(true, 200, "OK", sampleManifestResponse), ); - const result = fetchManifest(); + const result = fetchManifest(ASTRAL_MANIFEST); await jest.runAllTimersAsync(); await expect(result).resolves.toEqual([ @@ -125,7 +138,7 @@ describe("manifest", () => { "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson", ]); - await expect(getLatestVersion()).resolves.toBe("0.9.26"); + await expect(getFirstVersion(ASTRAL_MANIFEST)).resolves.toBe("0.9.26"); expect(mockFetch).toHaveBeenCalledTimes(4); }); @@ -138,9 +151,9 @@ describe("manifest", () => { createStreamingMockResponse([`${sampleManifestResponse}\n`]), ); - await expect(getLatestVersion()).resolves.toBe("0.9.26"); + await expect(getFirstVersion(ASTRAL_MANIFEST)).resolves.toBe("0.9.26"); await expect( - getArtifact("0.9.26", "aarch64", "apple-darwin"), + getArtifact("0.9.26", "aarch64", "apple-darwin", ASTRAL_MANIFEST), ).resolves.toEqual({ archiveFormat: "tar.gz", checksum: @@ -160,9 +173,7 @@ describe("manifest", () => { createMockResponse(false, 503, "Service Unavailable", ""), ); - await expect( - fetchManifest("https://example.com/custom.ndjson"), - ).rejects.toThrow( + await expect(fetchManifest(customManifest)).rejects.toThrow( "Failed to fetch manifest data: 503 Service Unavailable", ); expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([ @@ -178,7 +189,7 @@ describe("manifest", () => { createMockResponse(true, 200, "OK", sampleManifestResponse), ); - const result = fetchManifest(); + const result = fetchManifest(ASTRAL_MANIFEST); await jest.runAllTimersAsync(); await expect(result).resolves.toHaveLength(2); @@ -189,7 +200,7 @@ describe("manifest", () => { jest.useFakeTimers(); mockFetch.mockRejectedValue(new Error("request timed out")); - const result = expect(fetchManifest()).rejects.toThrow( + const result = expect(fetchManifest(ASTRAL_MANIFEST)).rejects.toThrow( "request timed out", ); await jest.runAllTimersAsync(); @@ -203,20 +214,26 @@ describe("manifest", () => { createMockResponse(false, 500, "Internal Server Error", ""), ); - await expect(fetchManifest()).rejects.toThrow( + await expect(fetchManifest(ASTRAL_MANIFEST)).rejects.toThrow( "Failed to fetch manifest data: 500 Internal Server Error", ); }); - it("caches results per URL", async () => { + it("reuses a custom manifest across version and artifact lookups", async () => { mockFetch.mockResolvedValue( createMockResponse(true, 200, "OK", sampleManifestResponse), ); + await expect(getAllVersions(customManifest)).resolves.toEqual([ + "0.9.26", + "0.9.25", + ]); + await expect( + getArtifact("0.9.25", "aarch64", "apple-darwin", customManifest), + ).resolves.toBeDefined(); - await fetchManifest("https://example.com/custom.ndjson"); - await fetchManifest("https://example.com/custom.ndjson"); - - expect(mockFetch).toHaveBeenCalledTimes(1); + expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([ + "https://example.com/custom.ndjson", + ]); }); }); @@ -226,46 +243,50 @@ describe("manifest", () => { createMockResponse(true, 200, "OK", sampleManifestResponse), ); - const versions = await getAllVersions( - "https://example.com/custom.ndjson", - ); + const versions = await getAllVersions(customManifest); expect(versions).toEqual(["0.9.26", "0.9.25"]); }); }); - describe("getLatestVersion", () => { - it("returns the first version string", async () => { + describe("getFirstVersion", () => { + it.each([ASTRAL_MANIFEST, githubManifest])( + "stops after the first record from $url", + async (source) => { + const [latestVersion] = sampleManifestResponse.split("\n"); + const cancel = jest.fn(); + mockFetch.mockResolvedValue( + createStreamingMockResponse( + [ + latestVersion.slice(0, 100), + `${latestVersion.slice(100)}\n`, + "invalid trailing data\n", + ], + cancel, + ), + ); + + await expect(getFirstVersion(source)).resolves.toBe("0.9.26"); + await expect( + getArtifact("0.9.26", "aarch64", "apple-darwin", source), + ).resolves.toBeDefined(); + + expect(cancel).toHaveBeenCalledTimes(1); + expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([source.url]); + }, + ); + + it("does not fall back to Astral when direct GitHub fetching fails", async () => { mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", sampleManifestResponse), + createMockResponse(false, 503, "Service Unavailable", ""), ); - await expect( - getLatestVersion("https://example.com/custom.ndjson"), - ).resolves.toBe("0.9.26"); - }); - - it("stops reading the default manifest after the first record", async () => { - const [latestVersion] = sampleManifestResponse.split("\n"); - const cancel = jest.fn(); - mockFetch.mockResolvedValue( - createStreamingMockResponse( - [ - latestVersion.slice(0, 100), - `${latestVersion.slice(100)}\n`, - "invalid trailing data\n", - ], - cancel, - ), + await expect(getFirstVersion(githubManifest)).rejects.toThrow( + "503 Service Unavailable", ); - - await expect(getLatestVersion()).resolves.toBe("0.9.26"); - await expect( - getArtifact("0.9.26", "aarch64", "apple-darwin"), - ).resolves.toBeDefined(); - - expect(cancel).toHaveBeenCalledTimes(1); - expect(mockFetch).toHaveBeenCalledTimes(1); + expect(mockFetch.mock.calls.map(([url]) => url)).toEqual([ + "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson", + ]); }); it("does not fail when canceling the remaining response fails", async () => { @@ -276,7 +297,7 @@ describe("manifest", () => { ), ); - await expect(getLatestVersion()).resolves.toBe("0.9.26"); + await expect(getFirstVersion(ASTRAL_MANIFEST)).resolves.toBe("0.9.26"); }); }); @@ -291,7 +312,10 @@ describe("manifest", () => { ); await expect( - getFirstMatchingVersion((version) => version === "0.9.25"), + getFirstMatchingVersion( + (version) => version === "0.9.25", + ASTRAL_MANIFEST, + ), ).resolves.toBe("0.9.25"); expect(cancel).toHaveBeenCalledTimes(1); @@ -307,9 +331,12 @@ describe("manifest", () => { ); await expect( - getFirstMatchingVersion((version) => version === "0.0.1"), + getFirstMatchingVersion( + (version) => version === "0.0.1", + ASTRAL_MANIFEST, + ), ).resolves.toBeUndefined(); - await expect(getLatestVersion()).resolves.toBe("0.9.26"); + await expect(getFirstVersion(ASTRAL_MANIFEST)).resolves.toBe("0.9.26"); expect(mockFetch).toHaveBeenCalledTimes(1); }); @@ -323,7 +350,12 @@ describe("manifest", () => { }); it("finds an artifact by version and platform", async () => { - const artifact = await getArtifact("0.9.26", "aarch64", "apple-darwin"); + const artifact = await getArtifact( + "0.9.26", + "aarch64", + "apple-darwin", + ASTRAL_MANIFEST, + ); expect(artifact).toEqual({ archiveFormat: "tar.gz", @@ -335,7 +367,12 @@ describe("manifest", () => { }); it("finds a windows artifact", async () => { - const artifact = await getArtifact("0.9.26", "x86_64", "pc-windows-msvc"); + const artifact = await getArtifact( + "0.9.26", + "x86_64", + "pc-windows-msvc", + ASTRAL_MANIFEST, + ); expect(artifact).toEqual({ archiveFormat: "zip", @@ -351,7 +388,12 @@ describe("manifest", () => { createMockResponse(true, 200, "OK", multiVariantManifestResponse), ); - const artifact = await getArtifact("0.9.26", "aarch64", "apple-darwin"); + const artifact = await getArtifact( + "0.9.26", + "aarch64", + "apple-darwin", + ASTRAL_MANIFEST, + ); expect(artifact).toEqual({ archiveFormat: "zip", @@ -362,7 +404,12 @@ describe("manifest", () => { }); it("returns undefined for an unknown version", async () => { - const artifact = await getArtifact("0.0.1", "aarch64", "apple-darwin"); + const artifact = await getArtifact( + "0.0.1", + "aarch64", + "apple-darwin", + ASTRAL_MANIFEST, + ); expect(artifact).toBeUndefined(); }); @@ -372,6 +419,7 @@ describe("manifest", () => { "0.9.26", "aarch64", "unknown-linux-musl", + ASTRAL_MANIFEST, ); expect(artifact).toBeUndefined(); @@ -391,9 +439,9 @@ describe("manifest", () => { ); await expect( - getArtifact("0.0.1", "aarch64", "apple-darwin"), + getArtifact("0.0.1", "aarch64", "apple-darwin", ASTRAL_MANIFEST), ).rejects.toThrow("Failed to parse manifest data"); - await expect(getLatestVersion()).resolves.toBe("0.9.26"); + await expect(getFirstVersion(ASTRAL_MANIFEST)).resolves.toBe("0.9.26"); expect(mockFetch).toHaveBeenCalledTimes(2); }); @@ -424,9 +472,9 @@ describe("manifest", () => { ); await expect( - getArtifact("0.0.1", "aarch64", "apple-darwin"), + getArtifact("0.0.1", "aarch64", "apple-darwin", ASTRAL_MANIFEST), ).rejects.toThrow("response stream failed"); - await expect(getLatestVersion()).resolves.toBe("0.9.26"); + await expect(getFirstVersion(ASTRAL_MANIFEST)).resolves.toBe("0.9.26"); expect(mockFetch).toHaveBeenCalledTimes(2); }); diff --git a/__tests__/helpers/setup-inputs.ts b/__tests__/helpers/setup-inputs.ts index 26f6b66..695cd47 100644 --- a/__tests__/helpers/setup-inputs.ts +++ b/__tests__/helpers/setup-inputs.ts @@ -20,6 +20,11 @@ export function createSetupInputs( githubToken: "", ignoreEmptyWorkdir: false, ignoreNothingToCache: false, + manifestSource: { + custom: false, + newestFirst: true, + url: "https://example.com/uv.ndjson", + }, noProject: false, pruneCache: false, pythonArch: "", diff --git a/__tests__/utils/inputs.test.ts b/__tests__/utils/inputs.test.ts index be2c7cb..85aa662 100644 --- a/__tests__/utils/inputs.test.ts +++ b/__tests__/utils/inputs.test.ts @@ -108,11 +108,45 @@ describe("loadInputs", () => { expect(inputs.pythonArch).toBe(""); expect(inputs.exportPythonArch).toBe(false); expect(inputs.venvPath).toBe("/workspace/.venv"); - expect(inputs.manifestFile).toBeUndefined(); expect(inputs.requireChecksums).toBe(false); expect(inputs.resolutionStrategy).toBe("highest"); }); + it.each([ + [ + "true", + { + custom: false, + fallbackUrl: + "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson", + newestFirst: true, + url: "https://releases.astral.sh/github/versions/main/v1/uv.ndjson", + }, + ], + [ + "false", + { + custom: false, + newestFirst: true, + url: "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson", + }, + ], + ])("selects the official source when the mirror is %s", (mirror, source) => { + mockInputs["download-from-astral-mirror"] = mirror; + expect(loadInputs().manifestSource).toStrictEqual(source); + }); + + it("uses an explicit manifest source even with the mirror enabled", () => { + mockInputs["download-from-astral-mirror"] = "true"; + mockInputs["manifest-file"] = "https://example.com/custom.ndjson"; + + expect(loadInputs().manifestSource).toStrictEqual({ + custom: true, + newestFirst: false, + url: "https://example.com/custom.ndjson", + }); + }); + it("loads require-checksums", () => { mockInputs["require-checksums"] = "true"; expect(loadInputs().requireChecksums).toBe(true); diff --git a/action.yml b/action.yml index cc629f6..eef4306 100644 --- a/action.yml +++ b/action.yml @@ -87,7 +87,7 @@ inputs: description: "URL to a custom manifest file in the astral-sh/versions format." required: false download-from-astral-mirror: - description: "Download uv from the Astral mirror instead of directly from GitHub Releases." + description: "Use the Astral mirror for the default version manifest and uv release archives." default: "true" add-problem-matchers: description: "Add problem matchers." diff --git a/dist/save-cache/index.cjs b/dist/save-cache/index.cjs index f1b81b5..bbaa452 100644 --- a/dist/save-cache/index.cjs +++ b/dist/save-cache/index.cjs @@ -66230,6 +66230,19 @@ function getConfigValueFromTomlContent(filePath, fileContent, key) { __name(getConfigValueFromTomlContent, "getConfigValueFromTomlContent"); // src/utils/inputs.ts +var VERSIONS_MANIFEST_URL = "https://releases.astral.sh/github/versions/main/v1/uv.ndjson"; +var GITHUB_VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; +var ASTRAL_MANIFEST = { + custom: false, + fallbackUrl: GITHUB_VERSIONS_MANIFEST_URL, + newestFirst: true, + url: VERSIONS_MANIFEST_URL +}; +var GITHUB_MANIFEST = { + custom: false, + newestFirst: true, + url: GITHUB_VERSIONS_MANIFEST_URL +}; function loadInputs() { const workingDirectory = getInput("working-directory"); const version3 = getInput("version"); @@ -66261,8 +66274,8 @@ function loadInputs() { const toolDir = getToolDir(workingDirectory); const pythonDir = getUvPythonDir(); const githubToken = getInput("github-token"); - const manifestFile = getManifestFile(); const downloadFromAstralMirror = getInput("download-from-astral-mirror") === "true"; + const manifestSource = getManifestSource(downloadFromAstralMirror); const addProblemMatchers = getInput("add-problem-matchers") === "true"; const quiet2 = getInput("quiet") === "true"; const resolutionStrategy = getResolutionStrategy(); @@ -66280,7 +66293,7 @@ function loadInputs() { githubToken, ignoreEmptyWorkdir, ignoreNothingToCache, - manifestFile, + manifestSource, noProject, pruneCache: pruneCache2, pythonArch, @@ -66528,14 +66541,14 @@ function resolveRelativePath(workingDirectory, inputPath) { return hasNegation ? `!${resolvedPath}` : resolvedPath; } __name(resolveRelativePath, "resolveRelativePath"); -function getManifestFile() { - const manifestFileInput = getInput("manifest-file"); - if (manifestFileInput !== "") { - return manifestFileInput; +function getManifestSource(useAstralMirror) { + const manifestFile = getInput("manifest-file"); + if (manifestFile !== "") { + return { custom: true, newestFirst: false, url: manifestFile }; } - return void 0; + return useAstralMirror ? ASTRAL_MANIFEST : GITHUB_MANIFEST; } -__name(getManifestFile, "getManifestFile"); +__name(getManifestSource, "getManifestSource"); function getResolutionStrategy() { const resolutionStrategyInput = getInput("resolution-strategy"); if (resolutionStrategyInput === "lowest") { diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 3818c89..dc3879b 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -94877,8 +94877,8 @@ async function computeKeys(inputs, pythonVersion) { } // src/download/download-version.ts -var import_node_fs7 = require("node:fs"); -var path15 = __toESM(require("node:path"), 1); +var import_node_fs3 = require("node:fs"); +var path14 = __toESM(require("node:path"), 1); // node_modules/@actions/tool-cache/lib/tool-cache.js var crypto5 = __toESM(require("crypto"), 1); @@ -95319,8 +95319,6 @@ function _getGlobal(key, defaultValue) { var TOOL_CACHE_NAME = "uv"; var STATE_UV_PATH = "uv-path"; var STATE_UV_VERSION = "uv-version"; -var VERSIONS_MANIFEST_URL = "https://releases.astral.sh/github/versions/main/v1/uv.ndjson"; -var GITHUB_VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; var GITHUB_RELEASES_PREFIX = "https://github.com/astral-sh/uv/releases/download/"; var ASTRAL_MIRROR_PREFIX = "https://releases.astral.sh/github/uv/releases/download/"; @@ -101106,6 +101104,118 @@ async function validateFileCheckSum(filePath, expected) { }); } +// src/download/download-version.ts +function getIntrinsicChecksum(key, providedChecksum) { + const checksum = providedChecksum || KNOWN_CHECKSUMS[key]; + if (!checksum) { + throw new Error( + `No bundled checksum for ${key}. With require-checksums enabled, update setup-uv or provide the checksum input for this archive.` + ); + } + if (!/^[a-f0-9]{64}$/.test(checksum)) { + throw new Error(`Expected a SHA-256 checksum for ${key}.`); + } + return checksum; +} +function tryGetFromToolCache(arch3, version3, toolCacheName = TOOL_CACHE_NAME) { + debug(`Trying to get uv from tool cache for ${version3}...`); + const cachedVersions = findAllVersions(toolCacheName, arch3); + debug(`Cached versions: ${cachedVersions}`); + let resolvedVersion = evaluateVersions(cachedVersions, version3); + if (resolvedVersion === "") { + resolvedVersion = version3; + } + const installedPath = find(toolCacheName, resolvedVersion, arch3); + return { installedPath, version: resolvedVersion }; +} +async function downloadVersion(platform2, arch3, version3, artifact, checksum, githubToken, downloadFromAstralMirror = true, toolCacheName = TOOL_CACHE_NAME) { + const manifestChecksum = artifact.checksum; + const mirrorUrl = downloadFromAstralMirror ? rewriteToMirror(artifact.downloadUrl) : void 0; + const downloadUrl = mirrorUrl ?? artifact.downloadUrl; + try { + return await downloadArtifact( + downloadUrl, + `uv-${arch3}-${platform2}`, + platform2, + arch3, + version3, + checksum, + manifestChecksum, + githubTokenForUrl(downloadUrl, githubToken), + toolCacheName + ); + } catch (err) { + if (mirrorUrl === void 0) { + throw err; + } + warning2( + `Failed to download from mirror, falling back to GitHub Releases: ${err.message}` + ); + return await downloadArtifact( + artifact.downloadUrl, + `uv-${arch3}-${platform2}`, + platform2, + arch3, + version3, + checksum, + manifestChecksum, + githubTokenForUrl(artifact.downloadUrl, githubToken), + toolCacheName + ); + } +} +function rewriteToMirror(url2) { + if (!url2.startsWith(GITHUB_RELEASES_PREFIX)) { + return void 0; + } + return ASTRAL_MIRROR_PREFIX + url2.slice(GITHUB_RELEASES_PREFIX.length); +} +function githubTokenForUrl(downloadUrl, githubToken) { + try { + return new URL(downloadUrl).origin === "https://github.com" ? githubToken : void 0; + } catch { + return void 0; + } +} +async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, version3, checksum, manifestChecksum, githubToken, toolCacheName) { + info2(`Downloading uv from "${downloadUrl}" ...`); + const downloadPath = await downloadTool( + downloadUrl, + void 0, + githubToken + ); + await validateChecksum( + checksum, + downloadPath, + arch3, + platform2, + version3, + manifestChecksum + ); + let uvDir; + if (platform2 === "pc-windows-msvc") { + try { + uvDir = await extractTar2(downloadPath, void 0, "x"); + } catch (err) { + info2( + `Extracting with tar failed, falling back to zip extraction: ${err.message}` + ); + const extension = getExtension(platform2); + const fullPathWithExtension = `${downloadPath}${extension}`; + await import_node_fs3.promises.copyFile(downloadPath, fullPathWithExtension); + uvDir = await extractZip(fullPathWithExtension); + } + } else { + const extractedDir = await extractTar2(downloadPath); + uvDir = path14.join(extractedDir, artifactName); + } + const cachedToolDir = await cacheDir(uvDir, toolCacheName, version3, arch3); + return { cachedToolDir, version: version3 }; +} +function getExtension(platform2) { + return platform2 === "pc-windows-msvc" ? ".zip" : ".tar.gz"; +} + // src/download/manifest.ts var import_node_readline = require("node:readline"); var import_node_stream5 = require("node:stream"); @@ -101150,18 +101260,18 @@ function formatVariants(entries) { } // src/download/manifest.ts -var cachedManifestData = /* @__PURE__ */ new Map(); +var cachedManifestData = /* @__PURE__ */ new WeakMap(); var MANIFEST_FETCH_ATTEMPTS = 3; -async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) { - const cachedManifest = cachedManifestData.get(manifestUrl); +async function fetchManifest(source) { + const cachedManifest = cachedManifestData.get(source); if (cachedManifest?.complete === true) { - debug(`Using cached manifest data from ${manifestUrl}`); + debug(`Using cached manifest data from ${source.url}`); return cachedManifest.versions; } - const response = await fetchManifestResponse(manifestUrl); + const response = await fetchManifestResponse(source); const body2 = await response.text(); - const versions = parseManifest(body2, manifestUrl); - cachedManifestData.set(manifestUrl, { complete: true, versions }); + const versions = parseManifest(body2, source.url); + cachedManifestData.set(source, { complete: true, versions }); return versions; } function parseManifest(data, sourceDescription) { @@ -101183,30 +101293,31 @@ function parseManifest(data, sourceDescription) { } return versions; } -async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) { - const latestVersion = manifestUrl === VERSIONS_MANIFEST_URL ? (await findManifestVersion(() => true))?.version : (await fetchManifest(manifestUrl))[0]?.version; - if (latestVersion === void 0) { +async function getFirstVersion(source) { + const version3 = (await findManifestVersion(source, () => true))?.version; + if (version3 === void 0) { throw new Error("No versions found in manifest data"); } - debug(`Latest version from manifest: ${latestVersion}`); - return latestVersion; + return version3; } -async function getFirstMatchingVersion(predicate) { - return (await findManifestVersion((versionData) => predicate(versionData.version)))?.version; +async function getFirstMatchingVersion(predicate, source) { + return (await findManifestVersion( + source, + (versionData) => predicate(versionData.version) + ))?.version; } -async function getAllVersions(manifestUrl = VERSIONS_MANIFEST_URL) { - info2( - `Getting available versions from ${manifestSource(manifestUrl)} ...` - ); - const versions = await fetchManifest(manifestUrl); +async function getAllVersions(source) { + info2(`Getting available versions from ${source.url} ...`); + const versions = await fetchManifest(source); return versions.map((versionData) => versionData.version); } -async function getArtifact(version3, arch3, platform2, manifestUrl = VERSIONS_MANIFEST_URL) { - const versionData = manifestUrl === VERSIONS_MANIFEST_URL ? await findManifestVersion((candidate) => candidate.version === version3) : (await fetchManifest(manifestUrl)).find( +async function getArtifact(version3, arch3, platform2, source) { + const versionData = await findManifestVersion( + source, (candidate) => candidate.version === version3 ); if (!versionData) { - debug(`Version ${version3} not found in manifest ${manifestUrl}`); + debug(`Version ${version3} not found in manifest ${source.url}`); return void 0; } const targetPlatform = `${arch3}-${platform2}`; @@ -101229,17 +101340,17 @@ async function getArtifact(version3, arch3, platform2, manifestUrl = VERSIONS_MA downloadUrl: artifact.url }; } -async function fetchManifestResponse(manifestUrl) { +async function fetchManifestResponse(source) { try { - return await fetchManifestResponseFromUrl(manifestUrl); + return await fetchManifestResponseFromUrl(source.url); } catch (error2) { - if (manifestUrl !== VERSIONS_MANIFEST_URL) { + if (source.fallbackUrl === void 0) { throw error2; } info2( - `Failed to fetch manifest from Astral mirror, falling back to GitHub: ${error2.message}` + `Failed to fetch manifest from ${source.url}, falling back to ${source.fallbackUrl}: ${error2.message}` ); - return await fetchManifestResponseFromUrl(GITHUB_VERSIONS_MANIFEST_URL); + return await fetchManifestResponseFromUrl(source.fallbackUrl); } } async function fetchManifestResponseFromUrl(manifestUrl) { @@ -101268,19 +101379,19 @@ async function fetchManifestResponseFromUrl(manifestUrl) { } return response; } -async function findManifestVersion(predicate) { - const cachedManifest = cachedManifestData.get(VERSIONS_MANIFEST_URL); +async function findManifestVersion(source, predicate) { + if (!source.newestFirst) { + return (await fetchManifest(source)).find(predicate); + } + const cachedManifest = cachedManifestData.get(source); const cachedVersion = cachedManifest?.versions.find(predicate); if (cachedVersion !== void 0 || cachedManifest?.complete === true) { return cachedVersion; } - const response = await fetchManifestResponse(VERSIONS_MANIFEST_URL); + const response = await fetchManifestResponse(source); if (response.body === null) { - const versions2 = parseManifest( - await response.text(), - VERSIONS_MANIFEST_URL - ); - cachedManifestData.set(VERSIONS_MANIFEST_URL, { + const versions2 = parseManifest(await response.text(), source.url); + cachedManifestData.set(source, { complete: true, versions: versions2 }); @@ -101300,13 +101411,9 @@ async function findManifestVersion(predicate) { continue; } if (versions.length === 0) { - rejectLegacyManifest(record, VERSIONS_MANIFEST_URL); + rejectLegacyManifest(record, source.url); } - const versionData = parseManifestRecord( - record, - VERSIONS_MANIFEST_URL, - lineNumber - ); + const versionData = parseManifestRecord(record, source.url, lineNumber); versions.push(versionData); if (predicate(versionData)) { matchedVersion = versionData; @@ -101321,17 +101428,11 @@ async function findManifestVersion(predicate) { } } if (versions.length === 0) { - throw new Error(`Manifest at ${VERSIONS_MANIFEST_URL} is empty.`); + throw new Error(`Manifest at ${source.url} is empty.`); } - cachedManifestData.set(VERSIONS_MANIFEST_URL, { complete, versions }); + cachedManifestData.set(source, { complete, versions }); return matchedVersion; } -function manifestSource(manifestUrl) { - if (manifestUrl === VERSIONS_MANIFEST_URL) { - return VERSIONS_MANIFEST_URL; - } - return `manifest-file ${manifestUrl}`; -} function parseManifestRecord(record, sourceDescription, lineNumber) { let parsed; try { @@ -101375,482 +101476,78 @@ function isRecord(value) { return typeof value === "object" && value !== null; } -// node_modules/@renovatebot/pep440/lib/version.js -var VERSION_PATTERN = [ - "v?", - "(?:", - /* */ - "(?:(?[0-9]+)!)?", - // epoch - /* */ - "(?[0-9]+(?:\\.[0-9]+)*)", - // release segment - /* */ - "(?
",
-  // pre-release
-  /*    */
-  "[-_\\.]?",
-  /*    */
-  "(?(a|b|c|rc|alpha|beta|pre|preview))",
-  /*    */
-  "[-_\\.]?",
-  /*    */
-  "(?[0-9]+)?",
-  /* */
-  ")?",
-  /* */
-  "(?",
-  // post release
-  /*    */
-  "(?:-(?[0-9]+))",
-  /*    */
-  "|",
-  /*    */
-  "(?:",
-  /*        */
-  "[-_\\.]?",
-  /*        */
-  "(?post|rev|r)",
-  /*        */
-  "[-_\\.]?",
-  /*        */
-  "(?[0-9]+)?",
-  /*    */
-  ")",
-  /* */
-  ")?",
-  /* */
-  "(?",
-  // dev release
-  /*    */
-  "[-_\\.]?",
-  /*    */
-  "(?dev)",
-  /*    */
-  "[-_\\.]?",
-  /*    */
-  "(?[0-9]+)?",
-  /* */
-  ")?",
-  ")",
-  "(?:\\+(?[a-z0-9]+(?:[-_\\.][a-z0-9]+)*))?"
-  // local version
-].join("");
-var validRegex = new RegExp("^" + VERSION_PATTERN + "$", "i");
-var cleanRegex = new RegExp("^\\s*" + VERSION_PATTERN + "\\s*$", "i");
-function parse2(version3, regex) {
-  const { groups } = (regex || validRegex).exec(version3) || {};
-  if (!groups) {
-    return null;
-  }
-  const parsed = {
-    epoch: Number(groups.epoch ? groups.epoch : 0),
-    release: groups.release.split(".").map(Number),
-    pre: normalize_letter_version(groups.pre_l, groups.pre_n),
-    post: normalize_letter_version(
-      groups.post_l,
-      groups.post_n1 || groups.post_n2
-    ),
-    dev: normalize_letter_version(groups.dev_l, groups.dev_n),
-    local: parse_local_version(groups.local)
-  };
-  return parsed;
-}
-function stringify(parsed) {
-  if (!parsed) {
-    return null;
-  }
-  const { epoch, release, pre, post, dev, local } = parsed;
-  const parts = [];
-  if (epoch !== 0) {
-    parts.push(`${epoch}!`);
-  }
-  parts.push(release.join("."));
-  if (pre) {
-    parts.push(pre.join(""));
-  }
-  if (post) {
-    parts.push("." + post.join(""));
-  }
-  if (dev) {
-    parts.push("." + dev.join(""));
-  }
-  if (local) {
-    parts.push(`+${local}`);
-  }
-  return parts.join("");
-}
-function normalize_letter_version(letterIn, numberIn) {
-  let letter = letterIn;
-  let number = numberIn;
-  if (letter) {
-    if (!number) {
-      number = 0;
-    }
-    letter = letter.toLowerCase();
-    if (letter === "alpha") {
-      letter = "a";
-    } else if (letter === "beta") {
-      letter = "b";
-    } else if (["c", "pre", "preview"].includes(letter)) {
-      letter = "rc";
-    } else if (["rev", "r"].includes(letter)) {
-      letter = "post";
-    }
-    return [letter, Number(number)];
-  }
-  if (!letter && number) {
-    letter = "post";
-    return [letter, Number(number)];
-  }
-  return null;
-}
-function parse_local_version(local) {
-  if (local) {
-    return local.split(/[._-]/).map(
-      (part) => Number.isNaN(Number(part)) ? part.toLowerCase() : Number(part)
-    );
-  }
-  return null;
-}
-function explain(version3) {
-  const parsed = parse2(version3);
-  if (!parsed) {
-    return parsed;
-  }
-  const { epoch, release, pre, post, dev, local } = parsed;
-  let base_version = "";
-  if (epoch !== 0) {
-    base_version += epoch + "!";
-  }
-  base_version += release.join(".");
-  const is_prerelease = Boolean(dev || pre);
-  const is_devrelease = Boolean(dev);
-  const is_postrelease = Boolean(post);
-  return {
-    epoch,
-    release,
-    pre,
-    post: post ? post[1] : post,
-    dev: dev ? dev[1] : dev,
-    local: local ? local.join(".") : local,
-    public: stringify(parsed).split("+", 1)[0],
-    base_version,
-    is_prerelease,
-    is_devrelease,
-    is_postrelease
-  };
-}
-
-// node_modules/@renovatebot/pep440/lib/operator.js
-var operator_exports = {};
-__export(operator_exports, {
-  "!=": () => ne,
-  "<": () => lt,
-  "<=": () => le,
-  "==": () => eq,
-  "===": () => arbitrary,
-  ">": () => gt2,
-  ">=": () => ge,
-  compare: () => compare,
-  eq: () => eq,
-  ge: () => ge,
-  gt: () => gt2,
-  le: () => le,
-  lt: () => lt,
-  ne: () => ne,
-  rcompare: () => rcompare
-});
-function lt(version3, other) {
-  return compare(version3, other) < 0;
-}
-function le(version3, other) {
-  return compare(version3, other) <= 0;
-}
-function eq(version3, other) {
-  return compare(version3, other) === 0;
-}
-function ne(version3, other) {
-  return compare(version3, other) !== 0;
-}
-function ge(version3, other) {
-  return compare(version3, other) >= 0;
-}
-function gt2(version3, other) {
-  return compare(version3, other) > 0;
-}
-function arbitrary(version3, other) {
-  return version3.toLowerCase() === other.toLowerCase();
-}
-function compare(version3, other) {
-  const parsedVersion = parse2(version3);
-  const parsedOther = parse2(other);
-  const keyVersion = calculateKey(parsedVersion);
-  const keyOther = calculateKey(parsedOther);
-  return pyCompare(keyVersion, keyOther);
-}
-function rcompare(version3, other) {
-  return -compare(version3, other);
-}
-function pyCompare(elemIn, otherIn) {
-  let elem = elemIn;
-  let other = otherIn;
-  if (elem === other) {
-    return 0;
-  }
-  if (Array.isArray(elem) !== Array.isArray(other)) {
-    elem = Array.isArray(elem) ? elem : [elem];
-    other = Array.isArray(other) ? other : [other];
-  }
-  if (Array.isArray(elem)) {
-    const len = Math.min(elem.length, other.length);
-    for (let i = 0; i < len; i += 1) {
-      const res = pyCompare(elem[i], other[i]);
-      if (res !== 0) {
-        return res;
-      }
-    }
-    return elem.length - other.length;
-  }
-  if (elem === -Infinity || other === Infinity) {
-    return -1;
-  }
-  if (elem === Infinity || other === -Infinity) {
-    return 1;
-  }
-  return elem < other ? -1 : 1;
-}
-function calculateKey(input) {
-  const { epoch } = input;
-  let { release, pre, post, local, dev } = input;
-  release = release.concat();
-  release.reverse();
-  while (release.length && release[0] === 0) {
-    release.shift();
-  }
-  release.reverse();
-  if (!pre && !post && dev) pre = -Infinity;
-  else if (!pre) pre = Infinity;
-  if (!post) post = -Infinity;
-  if (!dev) dev = Infinity;
-  if (!local) {
-    local = -Infinity;
-  } else {
-    local = local.map(
-      (i) => Number.isNaN(Number(i)) ? [-Infinity, i] : [Number(i), ""]
-    );
-  }
-  return [epoch, release, pre, post, dev, local];
-}
-
-// node_modules/@renovatebot/pep440/lib/specifier.js
-var RANGE_PATTERN = [
-  "(?(===|~=|==|!=|<=|>=|<|>))",
-  "\\s*",
-  "(",
-  /*  */
-  "(?(?:" + VERSION_PATTERN.replace(/\?<\w+>/g, "?:") + "))",
-  /*  */
-  "(?\\.\\*)?",
-  /*  */
-  "|",
-  /*  */
-  "(?[^,;\\s)]+)",
-  ")"
-].join("");
-var isEqualityOperator = (op) => ["==", "!=", "==="].includes(op);
-var rangeRegex = new RegExp("^" + RANGE_PATTERN + "$", "i");
-function parse3(ranges) {
-  if (!ranges.trim()) {
-    return [];
-  }
-  const specifiers = ranges.split(",").map((range3) => rangeRegex.exec(range3.trim()) || {}).map(({ groups }) => {
-    if (!groups) {
-      return null;
-    }
-    let { ...spec } = groups;
-    const { operator, version: version3, prefix: prefix2, legacy } = groups;
-    if (version3) {
-      spec = { ...spec, ...explain(version3) };
-      if (operator === "~=") {
-        if (spec.release.length < 2) {
-          return null;
-        }
-      }
-      if (!isEqualityOperator(operator) && spec.local) {
-        return null;
-      }
-      if (prefix2) {
-        if (!isEqualityOperator(operator) || spec.dev || spec.local) {
-          return null;
-        }
-      }
-    }
-    if (legacy && operator !== "===") {
-      return null;
-    }
-    return spec;
-  });
-  if (specifiers.filter(Boolean).length !== specifiers.length) {
-    return null;
-  }
-  return specifiers;
-}
-function filter2(versions, specifier, options = {}) {
-  const filtered = pick(versions, specifier, options);
-  if (filtered.length === 0 && options.prereleases === void 0) {
-    return pick(versions, specifier, { prereleases: true });
-  }
-  return filtered;
-}
-function maxSatisfying(versions, range3, options) {
-  const found = filter2(versions, range3, options).sort(compare);
-  return found.length === 0 ? null : found[found.length - 1];
-}
-function minSatisfying(versions, range3, options) {
-  const found = filter2(versions, range3, options).sort(compare);
-  return found.length === 0 ? null : found[0];
-}
-function pick(versions, specifier, options) {
-  const parsed = parse3(specifier);
-  if (!parsed) {
-    return [];
-  }
-  return versions.filter((version3) => {
-    const explained = explain(version3);
-    if (!parsed.length) {
-      return explained && !(explained.is_prerelease && !options.prereleases);
-    }
-    return parsed.reduce((pass, spec) => {
-      if (!pass) {
-        return false;
-      }
-      return contains({ ...spec, ...options }, { version: version3, explained });
-    }, true);
-  });
-}
-function satisfies3(version3, specifier, options = {}) {
-  const filtered = pick([version3], specifier, options);
-  return filtered.length === 1;
-}
-function arrayStartsWith(array, prefix2) {
-  if (prefix2.length > array.length) {
-    return false;
-  }
-  for (let i = 0; i < prefix2.length; i += 1) {
-    if (prefix2[i] !== array[i]) {
-      return false;
-    }
-  }
-  return true;
-}
-function contains(specifier, input) {
-  const { explained } = input;
-  let { version: version3 } = input;
-  const { ...spec } = specifier;
-  if (spec.prereleases === void 0) {
-    spec.prereleases = spec.is_prerelease;
-  }
-  if (explained && explained.is_prerelease && !spec.prereleases) {
-    return false;
-  }
-  if (spec.operator === "~=") {
-    let compatiblePrefix = spec.release.slice(0, -1).concat("*").join(".");
-    if (spec.epoch) {
-      compatiblePrefix = spec.epoch + "!" + compatiblePrefix;
-    }
-    return satisfies3(version3, `>=${spec.version}, ==${compatiblePrefix}`, {
-      prereleases: spec.prereleases
-    });
-  }
-  if (spec.prefix) {
-    const isMatching = explained.epoch === spec.epoch && arrayStartsWith(explained.release, spec.release);
-    const isEquality = spec.operator !== "!=";
-    return isEquality ? isMatching : !isMatching;
-  }
-  if (explained) {
-    if (explained.local && spec.version) {
-      version3 = explained.public;
-      spec.version = explain(spec.version).public;
-    }
-  }
-  if (spec.operator === "<" || spec.operator === ">") {
-    if (eq(spec.release.join("."), explained.release.join("."))) {
-      return false;
-    }
-  }
-  const op = operator_exports[spec.operator];
-  return op(version3, spec.version || spec.legacy);
-}
-function validRange(specifier) {
-  return Boolean(parse3(specifier));
-}
-
-// src/version/resolve.ts
-var semver5 = __toESM(require_semver5(), 1);
-
-// src/download/checksum/known-version.ts
-var semver4 = __toESM(require_semver5(), 1);
-var VERSION_IN_CHECKSUM_KEY_PATTERN = /-(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)$/;
-function getLatestKnownVersion() {
-  const versions = /* @__PURE__ */ new Set();
-  for (const key of Object.keys(KNOWN_CHECKSUMS)) {
-    const version3 = key.match(VERSION_IN_CHECKSUM_KEY_PATTERN)?.[1];
-    if (version3 !== void 0) {
-      versions.add(version3);
-    }
-  }
-  const latestVersion = [...versions].sort(semver4.rcompare)[0];
-  if (!latestVersion) {
-    throw new Error("Could not determine latest known version from checksums.");
-  }
-  return latestVersion;
-}
-
-// src/version/specifier.ts
-function normalizeVersionSpecifier(specifier) {
-  const trimmedSpecifier = specifier.trim();
-  if (trimmedSpecifier.startsWith("==")) {
-    const pinnedVersion = trimmedSpecifier.slice(2).trim();
-    if (isExplicitVersion(pinnedVersion)) {
-      return pinnedVersion;
-    }
-  }
-  return trimmedSpecifier;
-}
-function parseVersionSpecifier(specifier) {
-  const raw = specifier.trim();
-  const normalized = normalizeVersionSpecifier(raw);
-  if (normalized === "latest") {
-    return {
-      kind: "latest",
-      normalized: "latest",
-      raw
-    };
-  }
-  if (isExplicitVersion(normalized)) {
-    return {
-      kind: "exact",
-      normalized,
-      raw
-    };
-  }
-  return {
-    isSimpleMinimumVersionSpecifier: raw.includes(">") && !raw.includes(","),
-    kind: "range",
-    normalized,
-    raw
-  };
-}
-
-// src/version/version-request-resolver.ts
-var path14 = __toESM(require("node:path"), 1);
-
-// src/version/file-parser.ts
+// src/utils/inputs.ts
 var import_node_fs6 = __toESM(require("node:fs"), 1);
+var import_node_path2 = __toESM(require("node:path"), 1);
+
+// src/version/tool-versions-file.ts
+var import_node_fs4 = __toESM(require("node:fs"), 1);
+function getUvVersionFromToolVersions(filePath) {
+  const versions = getToolVersions(filePath, "uv");
+  if (versions === void 0 || versions.length !== 1) {
+    return void 0;
+  }
+  const version3 = stripVersionPrefix(versions[0]);
+  if (isPath(version3)) {
+    warning(
+      `The uv version ${versions[0]} in .tool-versions is not supported. Paths are not allowed.`
+    );
+    return void 0;
+  }
+  if (version3.startsWith("ref")) {
+    warning(
+      "The ref syntax of .tool-versions is not supported. Please use a released version instead."
+    );
+    return void 0;
+  }
+  return version3;
+}
+function getPythonVersionFromToolVersions(filePath) {
+  const versions = getToolVersions(filePath, "python");
+  if (versions === void 0 || versions.length === 0) {
+    return void 0;
+  }
+  if (versions.length > 1) {
+    warning(
+      "Multiple Python versions in .tool-versions are not supported. The Python entry will be ignored."
+    );
+    return void 0;
+  }
+  const version3 = stripVersionPrefix(versions[0]);
+  if (version3 === "system" || version3.startsWith("ref:") || version3.startsWith("path:") || isPath(version3)) {
+    warning(
+      `The Python version ${versions[0]} in .tool-versions is not supported. The Python entry will be ignored.`
+    );
+    return void 0;
+  }
+  return version3;
+}
+function getToolVersions(filePath, toolName) {
+  if (!filePath.endsWith(".tool-versions")) {
+    return void 0;
+  }
+  const fileContents = import_node_fs4.default.readFileSync(filePath, "utf8");
+  for (const line of fileContents.split("\n")) {
+    const content = line.split("#", 1)[0].trim();
+    if (content === "") {
+      continue;
+    }
+    const [tool, ...versions] = content.split(/\s+/);
+    if (tool === toolName) {
+      return versions;
+    }
+  }
+  return void 0;
+}
+function stripVersionPrefix(version3) {
+  return version3.startsWith("v") ? version3.slice(1) : version3;
+}
+function isPath(version3) {
+  return version3.includes("/") || version3.includes("\\");
+}
 
 // src/utils/config-file.ts
-var import_node_fs3 = __toESM(require("node:fs"), 1);
+var import_node_fs5 = __toESM(require("node:fs"), 1);
 
 // node_modules/smol-toml/dist/date.js
 var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
@@ -102430,7 +102127,7 @@ function peekTable(key, table, meta, type) {
   }
   return [k, t, state3.c];
 }
-function parse4(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
+function parse2(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
   let ctx = { s: toml, p: 0, d: maxDepth };
   let res = {};
   let meta = {};
@@ -102499,10 +102196,10 @@ function parse4(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
 
 // src/utils/config-file.ts
 function getConfigValueFromTomlFile(filePath, key) {
-  if (!import_node_fs3.default.existsSync(filePath) || !filePath.endsWith(".toml")) {
+  if (!import_node_fs5.default.existsSync(filePath) || !filePath.endsWith(".toml")) {
     return void 0;
   }
-  const fileContent = import_node_fs3.default.readFileSync(filePath, "utf-8");
+  const fileContent = import_node_fs5.default.readFileSync(filePath, "utf-8");
   return getConfigValueFromTomlContent(filePath, fileContent, key);
 }
 function getConfigValueFromTomlContent(filePath, fileContent, key) {
@@ -102510,582 +102207,27 @@ function getConfigValueFromTomlContent(filePath, fileContent, key) {
     return void 0;
   }
   if (filePath.endsWith("pyproject.toml")) {
-    const tomlContent2 = parse4(fileContent);
+    const tomlContent2 = parse2(fileContent);
     return tomlContent2?.tool?.uv?.[key];
   }
-  const tomlContent = parse4(fileContent);
+  const tomlContent = parse2(fileContent);
   return tomlContent[key];
 }
 
-// src/version/requirements-file.ts
-function getUvVersionFromRequirementsText(fileContent) {
-  return getUvVersionFromAllDependencies(fileContent.split("\n"));
-}
-function getUvVersionFromParsedPyproject(pyproject) {
-  const dependencies = pyproject?.project?.dependencies || [];
-  const optionalDependencies = Object.values(
-    pyproject?.project?.["optional-dependencies"] || {}
-  ).flat();
-  const devDependencies = Object.values(
-    pyproject?.["dependency-groups"] || {}
-  ).flat().filter((item) => typeof item === "string");
-  return getUvVersionFromAllDependencies(
-    dependencies.concat(optionalDependencies, devDependencies)
-  );
-}
-function parsePyprojectContent(pyprojectContent) {
-  return parse4(pyprojectContent);
-}
-function getUvVersionFromAllDependencies(allDependencies) {
-  return allDependencies.map(getUvVersionFromDependency).find((version3) => version3 !== void 0);
-}
-function getUvVersionFromDependency(dependency) {
-  const dependencyWithoutMarker = dependency.split(";", 1)[0]?.trim();
-  return dependencyWithoutMarker?.match(/^uv\s*((?:[=<>~!]+\s*[^\s,]+\s*,?\s*)+)/)?.[1].replace(/\s/g, "");
-}
-
-// src/version/tool-versions-file.ts
-var import_node_fs4 = __toESM(require("node:fs"), 1);
-function getUvVersionFromToolVersions(filePath) {
-  const versions = getToolVersions(filePath, "uv");
-  if (versions === void 0 || versions.length !== 1) {
-    return void 0;
-  }
-  const version3 = stripVersionPrefix(versions[0]);
-  if (isPath(version3)) {
-    warning(
-      `The uv version ${versions[0]} in .tool-versions is not supported. Paths are not allowed.`
-    );
-    return void 0;
-  }
-  if (version3.startsWith("ref")) {
-    warning(
-      "The ref syntax of .tool-versions is not supported. Please use a released version instead."
-    );
-    return void 0;
-  }
-  return version3;
-}
-function getPythonVersionFromToolVersions(filePath) {
-  const versions = getToolVersions(filePath, "python");
-  if (versions === void 0 || versions.length === 0) {
-    return void 0;
-  }
-  if (versions.length > 1) {
-    warning(
-      "Multiple Python versions in .tool-versions are not supported. The Python entry will be ignored."
-    );
-    return void 0;
-  }
-  const version3 = stripVersionPrefix(versions[0]);
-  if (version3 === "system" || version3.startsWith("ref:") || version3.startsWith("path:") || isPath(version3)) {
-    warning(
-      `The Python version ${versions[0]} in .tool-versions is not supported. The Python entry will be ignored.`
-    );
-    return void 0;
-  }
-  return version3;
-}
-function getToolVersions(filePath, toolName) {
-  if (!filePath.endsWith(".tool-versions")) {
-    return void 0;
-  }
-  const fileContents = import_node_fs4.default.readFileSync(filePath, "utf8");
-  for (const line of fileContents.split("\n")) {
-    const content = line.split("#", 1)[0].trim();
-    if (content === "") {
-      continue;
-    }
-    const [tool, ...versions] = content.split(/\s+/);
-    if (tool === toolName) {
-      return versions;
-    }
-  }
-  return void 0;
-}
-function stripVersionPrefix(version3) {
-  return version3.startsWith("v") ? version3.slice(1) : version3;
-}
-function isPath(version3) {
-  return version3.includes("/") || version3.includes("\\");
-}
-
-// src/version/uv-lock-file.ts
-var import_node_fs5 = __toESM(require("node:fs"), 1);
-function getUvVersionFromUvLock(filePath) {
-  const fileContent = import_node_fs5.default.readFileSync(filePath, "utf-8");
-  return getUvVersionFromUvLockContent(fileContent);
-}
-function getUvVersionFromUvLockContent(fileContent) {
-  const parsed = parse4(fileContent);
-  const uvPackage = parsed.package?.find((pkg) => pkg.name === "uv");
-  return uvPackage?.version;
-}
-
-// src/version/file-parser.ts
-var VERSION_FILE_PARSERS = [
-  {
-    format: ".tool-versions",
-    parse: (filePath) => getUvVersionFromToolVersions(filePath),
-    supports: (filePath) => filePath.endsWith(".tool-versions")
-  },
-  {
-    format: "uv.toml",
-    parse: (filePath) => {
-      const fileContent = import_node_fs6.default.readFileSync(filePath, "utf-8");
-      return getConfigValueFromTomlContent(
-        filePath,
-        fileContent,
-        "required-version"
-      );
-    },
-    supports: (filePath) => filePath.endsWith("uv.toml")
-  },
-  {
-    format: "pyproject.toml",
-    parse: (filePath) => {
-      const fileContent = import_node_fs6.default.readFileSync(filePath, "utf-8");
-      const pyproject = parsePyprojectContent(fileContent);
-      const requiredVersion = pyproject.tool?.uv?.["required-version"];
-      if (requiredVersion !== void 0) {
-        return requiredVersion;
-      }
-      return getUvVersionFromParsedPyproject(pyproject);
-    },
-    supports: (filePath) => filePath.endsWith("pyproject.toml")
-  },
-  {
-    format: "uv.lock",
-    parse: (filePath) => getUvVersionFromUvLock(filePath),
-    supports: (filePath) => filePath.endsWith("uv.lock")
-  },
-  {
-    format: "requirements",
-    parse: (filePath) => {
-      const fileContent = import_node_fs6.default.readFileSync(filePath, "utf-8");
-      return getUvVersionFromRequirementsText(fileContent);
-    },
-    supports: (filePath) => filePath.endsWith(".txt")
-  }
-];
-function getParsedVersionFile(filePath) {
-  info2(`Trying to find version for uv in: ${filePath}`);
-  if (!import_node_fs6.default.existsSync(filePath)) {
-    info2(`Could not find file: ${filePath}`);
-    return void 0;
-  }
-  const parser = getVersionFileParser(filePath);
-  if (parser === void 0) {
-    return void 0;
-  }
-  try {
-    const specifier = parser.parse(filePath);
-    if (specifier === void 0) {
-      return void 0;
-    }
-    const normalizedSpecifier = normalizeVersionSpecifier(specifier);
-    info2(`Found version for uv in ${filePath}: ${normalizedSpecifier}`);
-    return {
-      format: parser.format,
-      specifier: normalizedSpecifier
-    };
-  } catch (error2) {
-    warning2(`Error while parsing ${filePath}: ${error2.message}`);
-    return void 0;
-  }
-}
-function getVersionFileParser(filePath) {
-  return VERSION_FILE_PARSERS.find((parser) => parser.supports(filePath));
-}
-
-// src/version/version-request-resolver.ts
-var VersionRequestContext = class {
-  version;
-  versionFile;
-  workingDirectory;
-  parsedFiles = /* @__PURE__ */ new Map();
-  constructor(version3, versionFile, workingDirectory) {
-    this.version = version3;
-    this.versionFile = versionFile;
-    this.workingDirectory = workingDirectory;
-  }
-  getVersionFile(filePath) {
-    const cachedResult = this.parsedFiles.get(filePath);
-    if (cachedResult !== void 0 || this.parsedFiles.has(filePath)) {
-      return cachedResult;
-    }
-    const result = getParsedVersionFile(filePath);
-    this.parsedFiles.set(filePath, result);
-    return result;
-  }
-  getWorkspaceCandidates() {
-    return [
-      {
-        source: "uv.toml",
-        sourcePath: path14.join(this.workingDirectory, "uv.toml")
-      },
-      {
-        source: "pyproject.toml",
-        sourcePath: path14.join(this.workingDirectory, "pyproject.toml")
-      }
-    ];
-  }
-};
-var ExplicitInputVersionResolver = class {
-  resolve(context3) {
-    if (context3.version === void 0) {
-      return void 0;
-    }
-    return {
-      source: "input",
-      specifier: normalizeVersionSpecifier(context3.version)
-    };
-  }
-};
-var VersionFileVersionResolver = class {
-  resolve(context3) {
-    if (context3.versionFile === void 0) {
-      return void 0;
-    }
-    const versionFile = context3.getVersionFile(context3.versionFile);
-    if (versionFile === void 0) {
-      throw new Error(
-        `Could not determine uv version from file: ${context3.versionFile}`
-      );
-    }
-    return {
-      format: versionFile.format,
-      source: "version-file",
-      sourcePath: context3.versionFile,
-      specifier: versionFile.specifier
-    };
-  }
-};
-var WorkspaceVersionResolver = class {
-  resolve(context3) {
-    for (const candidate of context3.getWorkspaceCandidates()) {
-      const versionFile = context3.getVersionFile(candidate.sourcePath);
-      if (versionFile === void 0) {
-        continue;
-      }
-      return {
-        format: versionFile.format,
-        source: candidate.source,
-        sourcePath: candidate.sourcePath,
-        specifier: versionFile.specifier
-      };
-    }
-    info2(
-      "Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest."
-    );
-    return void 0;
-  }
-};
-var LatestVersionResolver = class {
-  resolve() {
-    return {
-      source: "default",
-      specifier: "latest"
-    };
-  }
-};
-var VERSION_REQUEST_RESOLVERS = [
-  new ExplicitInputVersionResolver(),
-  new VersionFileVersionResolver(),
-  new WorkspaceVersionResolver(),
-  new LatestVersionResolver()
-];
-function resolveVersionRequest(options) {
-  const context3 = new VersionRequestContext(
-    emptyToUndefined(options.version),
-    emptyToUndefined(options.versionFile),
-    options.workingDirectory
-  );
-  for (const resolver of VERSION_REQUEST_RESOLVERS) {
-    const request = resolver.resolve(context3);
-    if (request !== void 0) {
-      return request;
-    }
-  }
-  throw new Error("Could not resolve a requested uv version.");
-}
-function emptyToUndefined(value) {
-  return value === void 0 || value === "" ? void 0 : value;
-}
-
-// src/version/resolve.ts
-var ExactVersionResolver = class {
-  async resolve(context3) {
-    if (context3.parsedSpecifier.kind !== "exact") {
-      return void 0;
-    }
-    debug(
-      `Version ${context3.parsedSpecifier.normalized} is an explicit version.`
-    );
-    return context3.parsedSpecifier.normalized;
-  }
-};
-var LatestVersionResolver2 = class {
-  async resolve(context3) {
-    const shouldUseLatestVersion = context3.parsedSpecifier.kind === "latest" || context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier && context3.resolutionStrategy === "highest";
-    if (!shouldUseLatestVersion) {
-      return void 0;
-    }
-    if (context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier) {
-      info2("Found minimum version specifier, using latest version");
-    }
-    const latestVersion = await getLatestVersion(context3.manifestUrl);
-    if (context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier && !satisfies3(latestVersion, context3.parsedSpecifier.raw)) {
-      throw new Error(`No version found for ${context3.parsedSpecifier.raw}`);
-    }
-    return latestVersion;
-  }
-};
-var RangeVersionResolver = class {
-  async resolve(context3) {
-    if (context3.parsedSpecifier.kind !== "range") {
-      return void 0;
-    }
-    let resolvedVersion;
-    if (context3.resolutionStrategy === "highest" && (context3.manifestUrl === void 0 || context3.manifestUrl === VERSIONS_MANIFEST_URL)) {
-      resolvedVersion = await findHighestSatisfyingVersion(
-        context3.parsedSpecifier.normalized
-      );
-    } else {
-      const availableVersions = await getAllVersions(context3.manifestUrl);
-      debug(`Available versions: ${availableVersions}`);
-      resolvedVersion = context3.resolutionStrategy === "lowest" ? minSatisfying3(availableVersions, context3.parsedSpecifier.normalized) : maxSatisfying2(
-        availableVersions,
-        context3.parsedSpecifier.normalized
-      );
-    }
-    if (resolvedVersion === void 0) {
-      throw new Error(`No version found for ${context3.parsedSpecifier.raw}`);
-    }
-    return resolvedVersion;
-  }
-};
-var CONCRETE_VERSION_RESOLVERS = [
-  new ExactVersionResolver(),
-  new LatestVersionResolver2(),
-  new RangeVersionResolver()
-];
-async function resolveUvVersion(options) {
-  const request = resolveVersionRequest(options);
-  const resolutionStrategy = options.resolutionStrategy ?? "highest";
-  const version3 = await resolveVersion(
-    request.specifier,
-    options.manifestFile,
-    resolutionStrategy
-  );
-  return version3;
-}
-async function resolveVersion(versionInput, manifestUrl, resolutionStrategy = "highest") {
-  debug(`Resolving version: ${versionInput}`);
-  if (versionInput.trim() === "latest-known") {
-    return getLatestKnownVersion();
-  }
-  const context3 = {
-    manifestUrl,
-    parsedSpecifier: parseVersionSpecifier(versionInput),
-    resolutionStrategy
-  };
-  for (const resolver of CONCRETE_VERSION_RESOLVERS) {
-    const version3 = await resolver.resolve(context3);
-    if (version3 !== void 0) {
-      return version3;
-    }
-  }
-  throw new Error(`No version found for ${versionInput}`);
-}
-async function findHighestSatisfyingVersion(versionSpecifier) {
-  const semverRange = isPep440Specifier(versionSpecifier) ? null : semver5.validRange(versionSpecifier);
-  if (semverRange !== null) {
-    const semverMatch = await getFirstMatchingVersion(
-      (version3) => semver5.satisfies(version3, semverRange)
-    );
-    if (semverMatch !== void 0) {
-      debug(
-        `Found a version that satisfies the semver range: ${semverMatch}`
-      );
-      return semverMatch;
-    }
-  }
-  const pep440Match = await getFirstMatchingVersion(
-    (version3) => satisfies3(version3, versionSpecifier)
-  );
-  if (pep440Match !== void 0) {
-    debug(
-      `Found a version that satisfies the pep440 specifier: ${pep440Match}`
-    );
-  }
-  return pep440Match;
-}
-function isPep440Specifier(versionSpecifier) {
-  return validRange(versionSpecifier);
-}
-function maxSatisfying2(versions, version3) {
-  const maxSemver = isPep440Specifier(version3) ? "" : evaluateVersions(versions, version3);
-  if (maxSemver !== "") {
-    debug(`Found a version that satisfies the semver range: ${maxSemver}`);
-    return maxSemver;
-  }
-  const maxPep440 = maxSatisfying(versions, version3);
-  if (maxPep440 !== null) {
-    debug(
-      `Found a version that satisfies the pep440 specifier: ${maxPep440}`
-    );
-    return maxPep440;
-  }
-  return void 0;
-}
-function minSatisfying3(versions, version3) {
-  const minSemver = isPep440Specifier(version3) ? null : semver5.minSatisfying(versions, version3);
-  if (minSemver !== null) {
-    debug(`Found a version that satisfies the semver range: ${minSemver}`);
-    return minSemver;
-  }
-  const minPep440 = minSatisfying(versions, version3);
-  if (minPep440 !== null) {
-    debug(
-      `Found a version that satisfies the pep440 specifier: ${minPep440}`
-    );
-    return minPep440;
-  }
-  return void 0;
-}
-
-// src/download/download-version.ts
-function getIntrinsicChecksum(key, providedChecksum) {
-  const checksum = providedChecksum || KNOWN_CHECKSUMS[key];
-  if (!checksum) {
-    throw new Error(
-      `No bundled checksum for ${key}. With require-checksums enabled, update setup-uv or provide the checksum input for this archive.`
-    );
-  }
-  if (!/^[a-f0-9]{64}$/.test(checksum)) {
-    throw new Error(`Expected a SHA-256 checksum for ${key}.`);
-  }
-  return checksum;
-}
-function tryGetFromToolCache(arch3, version3, toolCacheName = TOOL_CACHE_NAME) {
-  debug(`Trying to get uv from tool cache for ${version3}...`);
-  const cachedVersions = findAllVersions(toolCacheName, arch3);
-  debug(`Cached versions: ${cachedVersions}`);
-  let resolvedVersion = evaluateVersions(cachedVersions, version3);
-  if (resolvedVersion === "") {
-    resolvedVersion = version3;
-  }
-  const installedPath = find(toolCacheName, resolvedVersion, arch3);
-  return { installedPath, version: resolvedVersion };
-}
-async function downloadVersion(platform2, arch3, version3, checksum, githubToken, manifestUrl, downloadFromAstralMirror = true, toolCacheName = TOOL_CACHE_NAME) {
-  const artifact = await getArtifact(version3, arch3, platform2, manifestUrl);
-  if (!artifact) {
-    throw new Error(
-      getMissingArtifactMessage(version3, arch3, platform2, manifestUrl)
-    );
-  }
-  const resolvedChecksum = manifestUrl === void 0 ? checksum : resolveChecksum(checksum, artifact.checksum);
-  const manifestChecksum = artifact.checksum;
-  const mirrorUrl = downloadFromAstralMirror ? rewriteToMirror(artifact.downloadUrl) : void 0;
-  const downloadUrl = mirrorUrl ?? artifact.downloadUrl;
-  try {
-    return await downloadArtifact(
-      downloadUrl,
-      `uv-${arch3}-${platform2}`,
-      platform2,
-      arch3,
-      version3,
-      resolvedChecksum,
-      manifestChecksum,
-      githubTokenForUrl(downloadUrl, githubToken),
-      toolCacheName
-    );
-  } catch (err) {
-    if (mirrorUrl === void 0) {
-      throw err;
-    }
-    warning2(
-      `Failed to download from mirror, falling back to GitHub Releases: ${err.message}`
-    );
-    return await downloadArtifact(
-      artifact.downloadUrl,
-      `uv-${arch3}-${platform2}`,
-      platform2,
-      arch3,
-      version3,
-      resolvedChecksum,
-      manifestChecksum,
-      githubTokenForUrl(artifact.downloadUrl, githubToken),
-      toolCacheName
-    );
-  }
-}
-function rewriteToMirror(url2) {
-  if (!url2.startsWith(GITHUB_RELEASES_PREFIX)) {
-    return void 0;
-  }
-  return ASTRAL_MIRROR_PREFIX + url2.slice(GITHUB_RELEASES_PREFIX.length);
-}
-function githubTokenForUrl(downloadUrl, githubToken) {
-  try {
-    return new URL(downloadUrl).origin === "https://github.com" ? githubToken : void 0;
-  } catch {
-    return void 0;
-  }
-}
-async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, version3, checksum, manifestChecksum, githubToken, toolCacheName) {
-  info2(`Downloading uv from "${downloadUrl}" ...`);
-  const downloadPath = await downloadTool(
-    downloadUrl,
-    void 0,
-    githubToken
-  );
-  await validateChecksum(
-    checksum,
-    downloadPath,
-    arch3,
-    platform2,
-    version3,
-    manifestChecksum
-  );
-  let uvDir;
-  if (platform2 === "pc-windows-msvc") {
-    try {
-      uvDir = await extractTar2(downloadPath, void 0, "x");
-    } catch (err) {
-      info2(
-        `Extracting with tar failed, falling back to zip extraction: ${err.message}`
-      );
-      const extension = getExtension(platform2);
-      const fullPathWithExtension = `${downloadPath}${extension}`;
-      await import_node_fs7.promises.copyFile(downloadPath, fullPathWithExtension);
-      uvDir = await extractZip(fullPathWithExtension);
-    }
-  } else {
-    const extractedDir = await extractTar2(downloadPath);
-    uvDir = path15.join(extractedDir, artifactName);
-  }
-  const cachedToolDir = await cacheDir(uvDir, toolCacheName, version3, arch3);
-  return { cachedToolDir, version: version3 };
-}
-function getMissingArtifactMessage(version3, arch3, platform2, manifestUrl) {
-  if (manifestUrl === void 0) {
-    return `Could not find artifact for version ${version3}, arch ${arch3}, platform ${platform2} in ${VERSIONS_MANIFEST_URL} .`;
-  }
-  return `manifest-file does not contain version ${version3}, arch ${arch3}, platform ${platform2}.`;
-}
-function resolveChecksum(checksum, manifestChecksum) {
-  return checksum !== void 0 && checksum !== "" ? checksum : manifestChecksum;
-}
-function getExtension(platform2) {
-  return platform2 === "pc-windows-msvc" ? ".zip" : ".tar.gz";
-}
-
 // src/utils/inputs.ts
-var import_node_fs8 = __toESM(require("node:fs"), 1);
-var import_node_path2 = __toESM(require("node:path"), 1);
+var VERSIONS_MANIFEST_URL = "https://releases.astral.sh/github/versions/main/v1/uv.ndjson";
+var GITHUB_VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
+var ASTRAL_MANIFEST = {
+  custom: false,
+  fallbackUrl: GITHUB_VERSIONS_MANIFEST_URL,
+  newestFirst: true,
+  url: VERSIONS_MANIFEST_URL
+};
+var GITHUB_MANIFEST = {
+  custom: false,
+  newestFirst: true,
+  url: GITHUB_VERSIONS_MANIFEST_URL
+};
 function loadInputs() {
   const workingDirectory = getInput("working-directory");
   const version3 = getInput("version");
@@ -103117,8 +102259,8 @@ function loadInputs() {
   const toolDir = getToolDir(workingDirectory);
   const pythonDir = getUvPythonDir();
   const githubToken = getInput("github-token");
-  const manifestFile = getManifestFile();
   const downloadFromAstralMirror = getInput("download-from-astral-mirror") === "true";
+  const manifestSource = getManifestSource(downloadFromAstralMirror);
   const addProblemMatchers = getInput("add-problem-matchers") === "true";
   const quiet2 = getInput("quiet") === "true";
   const resolutionStrategy = getResolutionStrategy();
@@ -103136,7 +102278,7 @@ function loadInputs() {
     githubToken,
     ignoreEmptyWorkdir,
     ignoreNothingToCache,
-    manifestFile,
+    manifestSource,
     noProject,
     pruneCache,
     pythonArch,
@@ -103171,7 +102313,7 @@ function getPythonVersion(versionFile) {
   if (process.env.UV_PYTHON !== void 0 && process.env.UV_PYTHON !== "") {
     return "";
   }
-  if (versionFile === "" || !import_node_fs8.default.existsSync(versionFile)) {
+  if (versionFile === "" || !import_node_fs6.default.existsSync(versionFile)) {
     return "";
   }
   try {
@@ -103369,12 +102511,12 @@ function resolveRelativePath(workingDirectory, inputPath) {
   );
   return hasNegation ? `!${resolvedPath}` : resolvedPath;
 }
-function getManifestFile() {
-  const manifestFileInput = getInput("manifest-file");
-  if (manifestFileInput !== "") {
-    return manifestFileInput;
+function getManifestSource(useAstralMirror) {
+  const manifestFile = getInput("manifest-file");
+  if (manifestFile !== "") {
+    return { custom: true, newestFirst: false, url: manifestFile };
   }
-  return void 0;
+  return useAstralMirror ? ASTRAL_MANIFEST : GITHUB_MANIFEST;
 }
 function getResolutionStrategy() {
   const resolutionStrategyInput = getInput("resolution-strategy");
@@ -103475,6 +102617,855 @@ async function getPythonRuntimeId(inputs) {
   }
 }
 
+// node_modules/@renovatebot/pep440/lib/version.js
+var VERSION_PATTERN = [
+  "v?",
+  "(?:",
+  /* */
+  "(?:(?[0-9]+)!)?",
+  // epoch
+  /* */
+  "(?[0-9]+(?:\\.[0-9]+)*)",
+  // release segment
+  /* */
+  "(?
",
+  // pre-release
+  /*    */
+  "[-_\\.]?",
+  /*    */
+  "(?(a|b|c|rc|alpha|beta|pre|preview))",
+  /*    */
+  "[-_\\.]?",
+  /*    */
+  "(?[0-9]+)?",
+  /* */
+  ")?",
+  /* */
+  "(?",
+  // post release
+  /*    */
+  "(?:-(?[0-9]+))",
+  /*    */
+  "|",
+  /*    */
+  "(?:",
+  /*        */
+  "[-_\\.]?",
+  /*        */
+  "(?post|rev|r)",
+  /*        */
+  "[-_\\.]?",
+  /*        */
+  "(?[0-9]+)?",
+  /*    */
+  ")",
+  /* */
+  ")?",
+  /* */
+  "(?",
+  // dev release
+  /*    */
+  "[-_\\.]?",
+  /*    */
+  "(?dev)",
+  /*    */
+  "[-_\\.]?",
+  /*    */
+  "(?[0-9]+)?",
+  /* */
+  ")?",
+  ")",
+  "(?:\\+(?[a-z0-9]+(?:[-_\\.][a-z0-9]+)*))?"
+  // local version
+].join("");
+var validRegex = new RegExp("^" + VERSION_PATTERN + "$", "i");
+var cleanRegex = new RegExp("^\\s*" + VERSION_PATTERN + "\\s*$", "i");
+function parse3(version3, regex) {
+  const { groups } = (regex || validRegex).exec(version3) || {};
+  if (!groups) {
+    return null;
+  }
+  const parsed = {
+    epoch: Number(groups.epoch ? groups.epoch : 0),
+    release: groups.release.split(".").map(Number),
+    pre: normalize_letter_version(groups.pre_l, groups.pre_n),
+    post: normalize_letter_version(
+      groups.post_l,
+      groups.post_n1 || groups.post_n2
+    ),
+    dev: normalize_letter_version(groups.dev_l, groups.dev_n),
+    local: parse_local_version(groups.local)
+  };
+  return parsed;
+}
+function stringify2(parsed) {
+  if (!parsed) {
+    return null;
+  }
+  const { epoch, release, pre, post, dev, local } = parsed;
+  const parts = [];
+  if (epoch !== 0) {
+    parts.push(`${epoch}!`);
+  }
+  parts.push(release.join("."));
+  if (pre) {
+    parts.push(pre.join(""));
+  }
+  if (post) {
+    parts.push("." + post.join(""));
+  }
+  if (dev) {
+    parts.push("." + dev.join(""));
+  }
+  if (local) {
+    parts.push(`+${local}`);
+  }
+  return parts.join("");
+}
+function normalize_letter_version(letterIn, numberIn) {
+  let letter = letterIn;
+  let number = numberIn;
+  if (letter) {
+    if (!number) {
+      number = 0;
+    }
+    letter = letter.toLowerCase();
+    if (letter === "alpha") {
+      letter = "a";
+    } else if (letter === "beta") {
+      letter = "b";
+    } else if (["c", "pre", "preview"].includes(letter)) {
+      letter = "rc";
+    } else if (["rev", "r"].includes(letter)) {
+      letter = "post";
+    }
+    return [letter, Number(number)];
+  }
+  if (!letter && number) {
+    letter = "post";
+    return [letter, Number(number)];
+  }
+  return null;
+}
+function parse_local_version(local) {
+  if (local) {
+    return local.split(/[._-]/).map(
+      (part) => Number.isNaN(Number(part)) ? part.toLowerCase() : Number(part)
+    );
+  }
+  return null;
+}
+function explain(version3) {
+  const parsed = parse3(version3);
+  if (!parsed) {
+    return parsed;
+  }
+  const { epoch, release, pre, post, dev, local } = parsed;
+  let base_version = "";
+  if (epoch !== 0) {
+    base_version += epoch + "!";
+  }
+  base_version += release.join(".");
+  const is_prerelease = Boolean(dev || pre);
+  const is_devrelease = Boolean(dev);
+  const is_postrelease = Boolean(post);
+  return {
+    epoch,
+    release,
+    pre,
+    post: post ? post[1] : post,
+    dev: dev ? dev[1] : dev,
+    local: local ? local.join(".") : local,
+    public: stringify2(parsed).split("+", 1)[0],
+    base_version,
+    is_prerelease,
+    is_devrelease,
+    is_postrelease
+  };
+}
+
+// node_modules/@renovatebot/pep440/lib/operator.js
+var operator_exports = {};
+__export(operator_exports, {
+  "!=": () => ne,
+  "<": () => lt,
+  "<=": () => le,
+  "==": () => eq,
+  "===": () => arbitrary,
+  ">": () => gt2,
+  ">=": () => ge,
+  compare: () => compare,
+  eq: () => eq,
+  ge: () => ge,
+  gt: () => gt2,
+  le: () => le,
+  lt: () => lt,
+  ne: () => ne,
+  rcompare: () => rcompare
+});
+function lt(version3, other) {
+  return compare(version3, other) < 0;
+}
+function le(version3, other) {
+  return compare(version3, other) <= 0;
+}
+function eq(version3, other) {
+  return compare(version3, other) === 0;
+}
+function ne(version3, other) {
+  return compare(version3, other) !== 0;
+}
+function ge(version3, other) {
+  return compare(version3, other) >= 0;
+}
+function gt2(version3, other) {
+  return compare(version3, other) > 0;
+}
+function arbitrary(version3, other) {
+  return version3.toLowerCase() === other.toLowerCase();
+}
+function compare(version3, other) {
+  const parsedVersion = parse3(version3);
+  const parsedOther = parse3(other);
+  const keyVersion = calculateKey(parsedVersion);
+  const keyOther = calculateKey(parsedOther);
+  return pyCompare(keyVersion, keyOther);
+}
+function rcompare(version3, other) {
+  return -compare(version3, other);
+}
+function pyCompare(elemIn, otherIn) {
+  let elem = elemIn;
+  let other = otherIn;
+  if (elem === other) {
+    return 0;
+  }
+  if (Array.isArray(elem) !== Array.isArray(other)) {
+    elem = Array.isArray(elem) ? elem : [elem];
+    other = Array.isArray(other) ? other : [other];
+  }
+  if (Array.isArray(elem)) {
+    const len = Math.min(elem.length, other.length);
+    for (let i = 0; i < len; i += 1) {
+      const res = pyCompare(elem[i], other[i]);
+      if (res !== 0) {
+        return res;
+      }
+    }
+    return elem.length - other.length;
+  }
+  if (elem === -Infinity || other === Infinity) {
+    return -1;
+  }
+  if (elem === Infinity || other === -Infinity) {
+    return 1;
+  }
+  return elem < other ? -1 : 1;
+}
+function calculateKey(input) {
+  const { epoch } = input;
+  let { release, pre, post, local, dev } = input;
+  release = release.concat();
+  release.reverse();
+  while (release.length && release[0] === 0) {
+    release.shift();
+  }
+  release.reverse();
+  if (!pre && !post && dev) pre = -Infinity;
+  else if (!pre) pre = Infinity;
+  if (!post) post = -Infinity;
+  if (!dev) dev = Infinity;
+  if (!local) {
+    local = -Infinity;
+  } else {
+    local = local.map(
+      (i) => Number.isNaN(Number(i)) ? [-Infinity, i] : [Number(i), ""]
+    );
+  }
+  return [epoch, release, pre, post, dev, local];
+}
+
+// node_modules/@renovatebot/pep440/lib/specifier.js
+var RANGE_PATTERN = [
+  "(?(===|~=|==|!=|<=|>=|<|>))",
+  "\\s*",
+  "(",
+  /*  */
+  "(?(?:" + VERSION_PATTERN.replace(/\?<\w+>/g, "?:") + "))",
+  /*  */
+  "(?\\.\\*)?",
+  /*  */
+  "|",
+  /*  */
+  "(?[^,;\\s)]+)",
+  ")"
+].join("");
+var isEqualityOperator = (op) => ["==", "!=", "==="].includes(op);
+var rangeRegex = new RegExp("^" + RANGE_PATTERN + "$", "i");
+function parse4(ranges) {
+  if (!ranges.trim()) {
+    return [];
+  }
+  const specifiers = ranges.split(",").map((range3) => rangeRegex.exec(range3.trim()) || {}).map(({ groups }) => {
+    if (!groups) {
+      return null;
+    }
+    let { ...spec } = groups;
+    const { operator, version: version3, prefix: prefix2, legacy } = groups;
+    if (version3) {
+      spec = { ...spec, ...explain(version3) };
+      if (operator === "~=") {
+        if (spec.release.length < 2) {
+          return null;
+        }
+      }
+      if (!isEqualityOperator(operator) && spec.local) {
+        return null;
+      }
+      if (prefix2) {
+        if (!isEqualityOperator(operator) || spec.dev || spec.local) {
+          return null;
+        }
+      }
+    }
+    if (legacy && operator !== "===") {
+      return null;
+    }
+    return spec;
+  });
+  if (specifiers.filter(Boolean).length !== specifiers.length) {
+    return null;
+  }
+  return specifiers;
+}
+function filter2(versions, specifier, options = {}) {
+  const filtered = pick(versions, specifier, options);
+  if (filtered.length === 0 && options.prereleases === void 0) {
+    return pick(versions, specifier, { prereleases: true });
+  }
+  return filtered;
+}
+function maxSatisfying(versions, range3, options) {
+  const found = filter2(versions, range3, options).sort(compare);
+  return found.length === 0 ? null : found[found.length - 1];
+}
+function minSatisfying(versions, range3, options) {
+  const found = filter2(versions, range3, options).sort(compare);
+  return found.length === 0 ? null : found[0];
+}
+function pick(versions, specifier, options) {
+  const parsed = parse4(specifier);
+  if (!parsed) {
+    return [];
+  }
+  return versions.filter((version3) => {
+    const explained = explain(version3);
+    if (!parsed.length) {
+      return explained && !(explained.is_prerelease && !options.prereleases);
+    }
+    return parsed.reduce((pass, spec) => {
+      if (!pass) {
+        return false;
+      }
+      return contains({ ...spec, ...options }, { version: version3, explained });
+    }, true);
+  });
+}
+function satisfies3(version3, specifier, options = {}) {
+  const filtered = pick([version3], specifier, options);
+  return filtered.length === 1;
+}
+function arrayStartsWith(array, prefix2) {
+  if (prefix2.length > array.length) {
+    return false;
+  }
+  for (let i = 0; i < prefix2.length; i += 1) {
+    if (prefix2[i] !== array[i]) {
+      return false;
+    }
+  }
+  return true;
+}
+function contains(specifier, input) {
+  const { explained } = input;
+  let { version: version3 } = input;
+  const { ...spec } = specifier;
+  if (spec.prereleases === void 0) {
+    spec.prereleases = spec.is_prerelease;
+  }
+  if (explained && explained.is_prerelease && !spec.prereleases) {
+    return false;
+  }
+  if (spec.operator === "~=") {
+    let compatiblePrefix = spec.release.slice(0, -1).concat("*").join(".");
+    if (spec.epoch) {
+      compatiblePrefix = spec.epoch + "!" + compatiblePrefix;
+    }
+    return satisfies3(version3, `>=${spec.version}, ==${compatiblePrefix}`, {
+      prereleases: spec.prereleases
+    });
+  }
+  if (spec.prefix) {
+    const isMatching = explained.epoch === spec.epoch && arrayStartsWith(explained.release, spec.release);
+    const isEquality = spec.operator !== "!=";
+    return isEquality ? isMatching : !isMatching;
+  }
+  if (explained) {
+    if (explained.local && spec.version) {
+      version3 = explained.public;
+      spec.version = explain(spec.version).public;
+    }
+  }
+  if (spec.operator === "<" || spec.operator === ">") {
+    if (eq(spec.release.join("."), explained.release.join("."))) {
+      return false;
+    }
+  }
+  const op = operator_exports[spec.operator];
+  return op(version3, spec.version || spec.legacy);
+}
+function validRange(specifier) {
+  return Boolean(parse4(specifier));
+}
+
+// src/version/resolve.ts
+var semver5 = __toESM(require_semver5(), 1);
+
+// src/download/checksum/known-version.ts
+var semver4 = __toESM(require_semver5(), 1);
+var VERSION_IN_CHECKSUM_KEY_PATTERN = /-(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)$/;
+function getLatestKnownVersion() {
+  const versions = /* @__PURE__ */ new Set();
+  for (const key of Object.keys(KNOWN_CHECKSUMS)) {
+    const version3 = key.match(VERSION_IN_CHECKSUM_KEY_PATTERN)?.[1];
+    if (version3 !== void 0) {
+      versions.add(version3);
+    }
+  }
+  const latestVersion = [...versions].sort(semver4.rcompare)[0];
+  if (!latestVersion) {
+    throw new Error("Could not determine latest known version from checksums.");
+  }
+  return latestVersion;
+}
+
+// src/version/specifier.ts
+function normalizeVersionSpecifier(specifier) {
+  const trimmedSpecifier = specifier.trim();
+  if (trimmedSpecifier.startsWith("==")) {
+    const pinnedVersion = trimmedSpecifier.slice(2).trim();
+    if (isExplicitVersion(pinnedVersion)) {
+      return pinnedVersion;
+    }
+  }
+  return trimmedSpecifier;
+}
+function parseVersionSpecifier(specifier) {
+  const raw = specifier.trim();
+  const normalized = normalizeVersionSpecifier(raw);
+  if (normalized === "latest") {
+    return {
+      kind: "latest",
+      normalized: "latest",
+      raw
+    };
+  }
+  if (isExplicitVersion(normalized)) {
+    return {
+      kind: "exact",
+      normalized,
+      raw
+    };
+  }
+  return {
+    isSimpleMinimumVersionSpecifier: raw.includes(">") && !raw.includes(","),
+    kind: "range",
+    normalized,
+    raw
+  };
+}
+
+// src/version/version-request-resolver.ts
+var path16 = __toESM(require("node:path"), 1);
+
+// src/version/file-parser.ts
+var import_node_fs8 = __toESM(require("node:fs"), 1);
+
+// src/version/requirements-file.ts
+function getUvVersionFromRequirementsText(fileContent) {
+  return getUvVersionFromAllDependencies(fileContent.split("\n"));
+}
+function getUvVersionFromParsedPyproject(pyproject) {
+  const dependencies = pyproject?.project?.dependencies || [];
+  const optionalDependencies = Object.values(
+    pyproject?.project?.["optional-dependencies"] || {}
+  ).flat();
+  const devDependencies = Object.values(
+    pyproject?.["dependency-groups"] || {}
+  ).flat().filter((item) => typeof item === "string");
+  return getUvVersionFromAllDependencies(
+    dependencies.concat(optionalDependencies, devDependencies)
+  );
+}
+function parsePyprojectContent(pyprojectContent) {
+  return parse2(pyprojectContent);
+}
+function getUvVersionFromAllDependencies(allDependencies) {
+  return allDependencies.map(getUvVersionFromDependency).find((version3) => version3 !== void 0);
+}
+function getUvVersionFromDependency(dependency) {
+  const dependencyWithoutMarker = dependency.split(";", 1)[0]?.trim();
+  return dependencyWithoutMarker?.match(/^uv\s*((?:[=<>~!]+\s*[^\s,]+\s*,?\s*)+)/)?.[1].replace(/\s/g, "");
+}
+
+// src/version/uv-lock-file.ts
+var import_node_fs7 = __toESM(require("node:fs"), 1);
+function getUvVersionFromUvLock(filePath) {
+  const fileContent = import_node_fs7.default.readFileSync(filePath, "utf-8");
+  return getUvVersionFromUvLockContent(fileContent);
+}
+function getUvVersionFromUvLockContent(fileContent) {
+  const parsed = parse2(fileContent);
+  const uvPackage = parsed.package?.find((pkg) => pkg.name === "uv");
+  return uvPackage?.version;
+}
+
+// src/version/file-parser.ts
+var VERSION_FILE_PARSERS = [
+  {
+    format: ".tool-versions",
+    parse: (filePath) => getUvVersionFromToolVersions(filePath),
+    supports: (filePath) => filePath.endsWith(".tool-versions")
+  },
+  {
+    format: "uv.toml",
+    parse: (filePath) => {
+      const fileContent = import_node_fs8.default.readFileSync(filePath, "utf-8");
+      return getConfigValueFromTomlContent(
+        filePath,
+        fileContent,
+        "required-version"
+      );
+    },
+    supports: (filePath) => filePath.endsWith("uv.toml")
+  },
+  {
+    format: "pyproject.toml",
+    parse: (filePath) => {
+      const fileContent = import_node_fs8.default.readFileSync(filePath, "utf-8");
+      const pyproject = parsePyprojectContent(fileContent);
+      const requiredVersion = pyproject.tool?.uv?.["required-version"];
+      if (requiredVersion !== void 0) {
+        return requiredVersion;
+      }
+      return getUvVersionFromParsedPyproject(pyproject);
+    },
+    supports: (filePath) => filePath.endsWith("pyproject.toml")
+  },
+  {
+    format: "uv.lock",
+    parse: (filePath) => getUvVersionFromUvLock(filePath),
+    supports: (filePath) => filePath.endsWith("uv.lock")
+  },
+  {
+    format: "requirements",
+    parse: (filePath) => {
+      const fileContent = import_node_fs8.default.readFileSync(filePath, "utf-8");
+      return getUvVersionFromRequirementsText(fileContent);
+    },
+    supports: (filePath) => filePath.endsWith(".txt")
+  }
+];
+function getParsedVersionFile(filePath) {
+  info2(`Trying to find version for uv in: ${filePath}`);
+  if (!import_node_fs8.default.existsSync(filePath)) {
+    info2(`Could not find file: ${filePath}`);
+    return void 0;
+  }
+  const parser = getVersionFileParser(filePath);
+  if (parser === void 0) {
+    return void 0;
+  }
+  try {
+    const specifier = parser.parse(filePath);
+    if (specifier === void 0) {
+      return void 0;
+    }
+    const normalizedSpecifier = normalizeVersionSpecifier(specifier);
+    info2(`Found version for uv in ${filePath}: ${normalizedSpecifier}`);
+    return {
+      format: parser.format,
+      specifier: normalizedSpecifier
+    };
+  } catch (error2) {
+    warning2(`Error while parsing ${filePath}: ${error2.message}`);
+    return void 0;
+  }
+}
+function getVersionFileParser(filePath) {
+  return VERSION_FILE_PARSERS.find((parser) => parser.supports(filePath));
+}
+
+// src/version/version-request-resolver.ts
+var VersionRequestContext = class {
+  version;
+  versionFile;
+  workingDirectory;
+  parsedFiles = /* @__PURE__ */ new Map();
+  constructor(version3, versionFile, workingDirectory) {
+    this.version = version3;
+    this.versionFile = versionFile;
+    this.workingDirectory = workingDirectory;
+  }
+  getVersionFile(filePath) {
+    const cachedResult = this.parsedFiles.get(filePath);
+    if (cachedResult !== void 0 || this.parsedFiles.has(filePath)) {
+      return cachedResult;
+    }
+    const result = getParsedVersionFile(filePath);
+    this.parsedFiles.set(filePath, result);
+    return result;
+  }
+  getWorkspaceCandidates() {
+    return [
+      {
+        source: "uv.toml",
+        sourcePath: path16.join(this.workingDirectory, "uv.toml")
+      },
+      {
+        source: "pyproject.toml",
+        sourcePath: path16.join(this.workingDirectory, "pyproject.toml")
+      }
+    ];
+  }
+};
+var ExplicitInputVersionResolver = class {
+  resolve(context3) {
+    if (context3.version === void 0) {
+      return void 0;
+    }
+    return {
+      source: "input",
+      specifier: normalizeVersionSpecifier(context3.version)
+    };
+  }
+};
+var VersionFileVersionResolver = class {
+  resolve(context3) {
+    if (context3.versionFile === void 0) {
+      return void 0;
+    }
+    const versionFile = context3.getVersionFile(context3.versionFile);
+    if (versionFile === void 0) {
+      throw new Error(
+        `Could not determine uv version from file: ${context3.versionFile}`
+      );
+    }
+    return {
+      format: versionFile.format,
+      source: "version-file",
+      sourcePath: context3.versionFile,
+      specifier: versionFile.specifier
+    };
+  }
+};
+var WorkspaceVersionResolver = class {
+  resolve(context3) {
+    for (const candidate of context3.getWorkspaceCandidates()) {
+      const versionFile = context3.getVersionFile(candidate.sourcePath);
+      if (versionFile === void 0) {
+        continue;
+      }
+      return {
+        format: versionFile.format,
+        source: candidate.source,
+        sourcePath: candidate.sourcePath,
+        specifier: versionFile.specifier
+      };
+    }
+    info2(
+      "Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest."
+    );
+    return void 0;
+  }
+};
+var LatestVersionResolver = class {
+  resolve() {
+    return {
+      source: "default",
+      specifier: "latest"
+    };
+  }
+};
+var VERSION_REQUEST_RESOLVERS = [
+  new ExplicitInputVersionResolver(),
+  new VersionFileVersionResolver(),
+  new WorkspaceVersionResolver(),
+  new LatestVersionResolver()
+];
+function resolveVersionRequest(options) {
+  const context3 = new VersionRequestContext(
+    emptyToUndefined(options.version),
+    emptyToUndefined(options.versionFile),
+    options.workingDirectory
+  );
+  for (const resolver of VERSION_REQUEST_RESOLVERS) {
+    const request = resolver.resolve(context3);
+    if (request !== void 0) {
+      return request;
+    }
+  }
+  throw new Error("Could not resolve a requested uv version.");
+}
+function emptyToUndefined(value) {
+  return value === void 0 || value === "" ? void 0 : value;
+}
+
+// src/version/resolve.ts
+var ExactVersionResolver = class {
+  async resolve(context3) {
+    if (context3.parsedSpecifier.kind !== "exact") {
+      return void 0;
+    }
+    debug(
+      `Version ${context3.parsedSpecifier.normalized} is an explicit version.`
+    );
+    return context3.parsedSpecifier.normalized;
+  }
+};
+var LatestVersionResolver2 = class {
+  async resolve(context3) {
+    const shouldUseLatestVersion = context3.parsedSpecifier.kind === "latest" || context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier && context3.resolutionStrategy === "highest";
+    if (!shouldUseLatestVersion) {
+      return void 0;
+    }
+    if (context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier) {
+      info2("Found minimum version specifier, using latest version");
+    }
+    const latestVersion = await getFirstVersion(context3.source);
+    if (context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier && !satisfies3(latestVersion, context3.parsedSpecifier.raw)) {
+      throw new Error(`No version found for ${context3.parsedSpecifier.raw}`);
+    }
+    return latestVersion;
+  }
+};
+var RangeVersionResolver = class {
+  async resolve(context3) {
+    if (context3.parsedSpecifier.kind !== "range") {
+      return void 0;
+    }
+    let resolvedVersion;
+    if (context3.resolutionStrategy === "highest" && context3.source.newestFirst) {
+      resolvedVersion = await findHighestSatisfyingVersion(
+        context3.parsedSpecifier.normalized,
+        context3.source
+      );
+    } else {
+      const availableVersions = await getAllVersions(context3.source);
+      debug(`Available versions: ${availableVersions}`);
+      resolvedVersion = context3.resolutionStrategy === "lowest" ? minSatisfying3(availableVersions, context3.parsedSpecifier.normalized) : maxSatisfying2(
+        availableVersions,
+        context3.parsedSpecifier.normalized
+      );
+    }
+    if (resolvedVersion === void 0) {
+      throw new Error(`No version found for ${context3.parsedSpecifier.raw}`);
+    }
+    return resolvedVersion;
+  }
+};
+var CONCRETE_VERSION_RESOLVERS = [
+  new ExactVersionResolver(),
+  new LatestVersionResolver2(),
+  new RangeVersionResolver()
+];
+async function resolveUvVersion(options, source) {
+  const request = resolveVersionRequest(options);
+  const resolutionStrategy = options.resolutionStrategy ?? "highest";
+  const version3 = await resolveVersion(
+    request.specifier,
+    source,
+    resolutionStrategy
+  );
+  return version3;
+}
+async function resolveVersion(versionInput, source, resolutionStrategy = "highest") {
+  debug(`Resolving version: ${versionInput}`);
+  if (versionInput.trim() === "latest-known") {
+    return getLatestKnownVersion();
+  }
+  const context3 = {
+    parsedSpecifier: parseVersionSpecifier(versionInput),
+    resolutionStrategy,
+    source
+  };
+  for (const resolver of CONCRETE_VERSION_RESOLVERS) {
+    const version3 = await resolver.resolve(context3);
+    if (version3 !== void 0) {
+      return version3;
+    }
+  }
+  throw new Error(`No version found for ${versionInput}`);
+}
+async function findHighestSatisfyingVersion(versionSpecifier, source) {
+  const semverRange = isPep440Specifier(versionSpecifier) ? null : semver5.validRange(versionSpecifier);
+  if (semverRange !== null) {
+    const semverMatch = await getFirstMatchingVersion(
+      (version3) => semver5.satisfies(version3, semverRange),
+      source
+    );
+    if (semverMatch !== void 0) {
+      debug(
+        `Found a version that satisfies the semver range: ${semverMatch}`
+      );
+      return semverMatch;
+    }
+  }
+  const pep440Match = await getFirstMatchingVersion(
+    (version3) => satisfies3(version3, versionSpecifier),
+    source
+  );
+  if (pep440Match !== void 0) {
+    debug(
+      `Found a version that satisfies the pep440 specifier: ${pep440Match}`
+    );
+  }
+  return pep440Match;
+}
+function isPep440Specifier(versionSpecifier) {
+  return validRange(versionSpecifier);
+}
+function maxSatisfying2(versions, version3) {
+  const maxSemver = isPep440Specifier(version3) ? "" : evaluateVersions(versions, version3);
+  if (maxSemver !== "") {
+    debug(`Found a version that satisfies the semver range: ${maxSemver}`);
+    return maxSemver;
+  }
+  const maxPep440 = maxSatisfying(versions, version3);
+  if (maxPep440 !== null) {
+    debug(
+      `Found a version that satisfies the pep440 specifier: ${maxPep440}`
+    );
+    return maxPep440;
+  }
+  return void 0;
+}
+function minSatisfying3(versions, version3) {
+  const minSemver = isPep440Specifier(version3) ? null : semver5.minSatisfying(versions, version3);
+  if (minSemver !== null) {
+    debug(`Found a version that satisfies the semver range: ${minSemver}`);
+    return minSemver;
+  }
+  const minPep440 = minSatisfying(versions, version3);
+  if (minPep440 !== null) {
+    debug(
+      `Found a version that satisfies the pep440 specifier: ${minPep440}`
+    );
+    return minPep440;
+  }
+  return void 0;
+}
+
 // src/setup-uv.ts
 var sourceDir = __dirname;
 function formatUnexpectedFailure(error2) {
@@ -103574,13 +103565,16 @@ function detectEmptyWorkdir(inputs) {
   }
 }
 async function setupUv(inputs, platform2, arch3) {
-  const resolvedVersion = await resolveUvVersion({
-    manifestFile: inputs.manifestFile,
-    resolutionStrategy: inputs.resolutionStrategy,
-    version: inputs.version,
-    versionFile: inputs.versionFile,
-    workingDirectory: inputs.workingDirectory
-  });
+  const { manifestSource } = inputs;
+  const resolvedVersion = await resolveUvVersion(
+    {
+      resolutionStrategy: inputs.resolutionStrategy,
+      version: inputs.version,
+      versionFile: inputs.versionFile,
+      workingDirectory: inputs.workingDirectory
+    },
+    manifestSource
+  );
   let checksum = inputs.checksum;
   let toolCacheName = TOOL_CACHE_NAME;
   if (inputs.requireChecksums) {
@@ -103602,13 +103596,28 @@ async function setupUv(inputs, platform2, arch3) {
       version: toolCacheResult.version
     };
   }
+  const artifact = await getArtifact(
+    resolvedVersion,
+    arch3,
+    platform2,
+    manifestSource
+  );
+  if (artifact === void 0) {
+    const target = `version ${resolvedVersion}, arch ${arch3}, platform ${platform2}`;
+    throw new Error(
+      manifestSource.custom ? `manifest-file does not contain ${target}.` : `Could not find artifact for ${target} in ${manifestSource.url} .`
+    );
+  }
+  if (manifestSource.custom) {
+    checksum = checksum || artifact.checksum;
+  }
   const downloadResult = await downloadVersion(
     platform2,
     arch3,
     resolvedVersion,
+    artifact,
     checksum,
     inputs.githubToken,
-    inputs.manifestFile,
     inputs.downloadFromAstralMirror,
     toolCacheName
   );
diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs
index 737188d..ed1a212 100644
--- a/dist/update-known-checksums/index.cjs
+++ b/dist/update-known-checksums/index.cjs
@@ -963,7 +963,7 @@ var require_util = __commonJS({
     var net = require("node:net");
     var { Blob: Blob2 } = require("node:buffer");
     var nodeUtil = require("node:util");
-    var { stringify } = require("node:querystring");
+    var { stringify: stringify2 } = require("node:querystring");
     var { EventEmitter: EE } = require("node:events");
     var { InvalidArgumentError } = require_errors();
     var { headerNameLowerCasedRecord } = require_constants();
@@ -1023,7 +1023,7 @@ var require_util = __commonJS({
       if (url.includes("?") || url.includes("#")) {
         throw new Error('Query params cannot be passed when url already contains "?" or "#".');
       }
-      const stringified = stringify(queryParams);
+      const stringified = stringify2(queryParams);
       if (stringified) {
         url += "?" + stringified;
       }
@@ -3425,7 +3425,7 @@ var require_data_url = __commonJS({
       const buffer = Buffer.from(data, "base64");
       return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
     }
-    function collectAnHTTPQuotedString(input, position, extractValue) {
+    function collectAnHTTPQuotedString(input, position, extractValue2) {
       const positionStart = position.position;
       let value = "";
       assert(input[position.position] === '"');
@@ -3453,7 +3453,7 @@ var require_data_url = __commonJS({
           break;
         }
       }
-      if (extractValue) {
+      if (extractValue2) {
         return value;
       }
       return input.slice(positionStart, position.position);
@@ -15920,7 +15920,7 @@ var require_util6 = __commonJS({
         throw new Error("Invalid cookie max-age");
       }
     }
-    function stringify(cookie) {
+    function stringify2(cookie) {
       if (cookie.name.length === 0) {
         return null;
       }
@@ -15974,7 +15974,7 @@ var require_util6 = __commonJS({
       validateCookiePath,
       validateCookieValue,
       toIMFDate,
-      stringify
+      stringify: stringify2
     };
   }
 });
@@ -16124,7 +16124,7 @@ var require_cookies = __commonJS({
   "node_modules/@actions/http-client/node_modules/undici/lib/web/cookies/index.js"(exports2, module2) {
     "use strict";
     var { parseSetCookie } = require_parse();
-    var { stringify } = require_util6();
+    var { stringify: stringify2 } = require_util6();
     var { webidl } = require_webidl();
     var { Headers: Headers2 } = require_headers();
     function getCookies(headers) {
@@ -16167,7 +16167,7 @@ var require_cookies = __commonJS({
       webidl.argumentLengthCheck(arguments, 2, "setCookie");
       webidl.brandCheck(headers, Headers2, { strict: false });
       cookie = webidl.converters.Cookie(cookie);
-      const str = stringify(cookie);
+      const str = stringify2(cookie);
       if (str) {
         headers.append("Set-Cookie", str);
       }
@@ -18724,8 +18724,8 @@ var require_semver = __commonJS({
       }
     }
     var i;
-    exports2.parse = parse;
-    function parse(version, options) {
+    exports2.parse = parse2;
+    function parse2(version, options) {
       if (!options || typeof options !== "object") {
         options = {
           loose: !!options,
@@ -18753,12 +18753,12 @@ var require_semver = __commonJS({
     }
     exports2.valid = valid;
     function valid(version, options) {
-      var v = parse(version, options);
+      var v = parse2(version, options);
       return v ? v.version : null;
     }
     exports2.clean = clean;
     function clean(version, options) {
-      var s = parse(version.trim().replace(/^[=v]+/, ""), options);
+      var s = parse2(version.trim().replace(/^[=v]+/, ""), options);
       return s ? s.version : null;
     }
     exports2.SemVer = SemVer;
@@ -18994,8 +18994,8 @@ var require_semver = __commonJS({
       if (eq(version1, version2)) {
         return null;
       } else {
-        var v1 = parse(version1);
-        var v2 = parse(version2);
+        var v1 = parse2(version1);
+        var v2 = parse2(version2);
         var prefix = "";
         if (v1.prerelease.length || v2.prerelease.length) {
           prefix = "pre";
@@ -19701,7 +19701,7 @@ var require_semver = __commonJS({
     }
     exports2.prerelease = prerelease;
     function prerelease(version, options) {
-      var parsed = parse(version, options);
+      var parsed = parse2(version, options);
       return parsed && parsed.prerelease.length ? parsed.prerelease : null;
     }
     exports2.intersects = intersects;
@@ -19738,7 +19738,7 @@ var require_semver = __commonJS({
       if (match === null) {
         return null;
       }
-      return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
+      return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
     }
   }
 });
@@ -20751,7 +20751,7 @@ var require_util9 = __commonJS({
     var { IncomingMessage } = require("node:http");
     var stream = require("node:stream");
     var net = require("node:net");
-    var { stringify } = require("node:querystring");
+    var { stringify: stringify2 } = require("node:querystring");
     var { EventEmitter: EE, addAbortListener: addAbortListenerNative } = require("node:events");
     var timers = require_timers2();
     var { InvalidArgumentError, ConnectTimeoutError } = require_errors2();
@@ -20807,7 +20807,7 @@ var require_util9 = __commonJS({
       if (pathHasQueryOrFragment(url)) {
         throw new Error('Query params cannot be passed when url already contains "?" or "#".');
       }
-      const stringified = stringify(queryParams);
+      const stringified = stringify2(queryParams);
       if (stringified) {
         url += "?" + stringified;
       }
@@ -23887,7 +23887,7 @@ var require_data_url2 = __commonJS({
       }
       return mimeType;
     }
-    function collectAnHTTPQuotedString(input, position, extractValue = false) {
+    function collectAnHTTPQuotedString(input, position, extractValue2 = false) {
       const positionStart = position.position;
       let value = "";
       assert(input[position.position] === '"');
@@ -23915,7 +23915,7 @@ var require_data_url2 = __commonJS({
           break;
         }
       }
-      if (extractValue) {
+      if (extractValue2) {
         return value;
       }
       return input.slice(positionStart, position.position);
@@ -43997,7 +43997,7 @@ var require_util12 = __commonJS({
         throw new Error("Invalid cookie max-age");
       }
     }
-    function stringify(cookie) {
+    function stringify2(cookie) {
       if (cookie.name.length === 0) {
         return null;
       }
@@ -44055,7 +44055,7 @@ var require_util12 = __commonJS({
       validateCookiePath,
       validateCookieValue,
       toIMFDate,
-      stringify
+      stringify: stringify2
     };
   }
 });
@@ -44206,7 +44206,7 @@ var require_cookies2 = __commonJS({
   "node_modules/undici/lib/web/cookies/index.js"(exports2, module2) {
     "use strict";
     var { parseSetCookie } = require_parse2();
-    var { stringify } = require_util12();
+    var { stringify: stringify2 } = require_util12();
     var { webidl } = require_webidl2();
     var globalHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.util.MakeTypeAssertion(globalThis.Headers));
     var undiciHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.is.Headers);
@@ -44262,7 +44262,7 @@ var require_cookies2 = __commonJS({
       webidl.argumentLengthCheck(arguments, 2, "setCookie");
       brandCheckHeaders(headers);
       cookie = webidl.converters.Cookie(cookie);
-      const str = stringify(cookie);
+      const str = stringify2(cookie);
       if (str) {
         headers.append("set-cookie", str, true);
       }
@@ -53733,10 +53733,6 @@ async function updateChecksums(filePath, checksumEntries) {
 var import_node_readline = require("node:readline");
 var import_node_stream = require("node:stream");
 
-// src/utils/constants.ts
-var VERSIONS_MANIFEST_URL = "https://releases.astral.sh/github/versions/main/v1/uv.ndjson";
-var GITHUB_VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
-
 // src/utils/fetch.ts
 var import_undici2 = __toESM(require_undici2(), 1);
 var fetch = async (url, opts) => {
@@ -53765,18 +53761,18 @@ function info2(msg) {
 }
 
 // src/download/manifest.ts
-var cachedManifestData = /* @__PURE__ */ new Map();
+var cachedManifestData = /* @__PURE__ */ new WeakMap();
 var MANIFEST_FETCH_ATTEMPTS = 3;
-async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) {
-  const cachedManifest = cachedManifestData.get(manifestUrl);
+async function fetchManifest(source) {
+  const cachedManifest = cachedManifestData.get(source);
   if (cachedManifest?.complete === true) {
-    debug(`Using cached manifest data from ${manifestUrl}`);
+    debug(`Using cached manifest data from ${source.url}`);
     return cachedManifest.versions;
   }
-  const response = await fetchManifestResponse(manifestUrl);
+  const response = await fetchManifestResponse(source);
   const body = await response.text();
-  const versions = parseManifest(body, manifestUrl);
-  cachedManifestData.set(manifestUrl, { complete: true, versions });
+  const versions = parseManifest(body, source.url);
+  cachedManifestData.set(source, { complete: true, versions });
   return versions;
 }
 function parseManifest(data, sourceDescription) {
@@ -53798,25 +53794,24 @@ function parseManifest(data, sourceDescription) {
   }
   return versions;
 }
-async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) {
-  const latestVersion = manifestUrl === VERSIONS_MANIFEST_URL ? (await findManifestVersion(() => true))?.version : (await fetchManifest(manifestUrl))[0]?.version;
-  if (latestVersion === void 0) {
+async function getFirstVersion(source) {
+  const version = (await findManifestVersion(source, () => true))?.version;
+  if (version === void 0) {
     throw new Error("No versions found in manifest data");
   }
-  debug(`Latest version from manifest: ${latestVersion}`);
-  return latestVersion;
+  return version;
 }
-async function fetchManifestResponse(manifestUrl) {
+async function fetchManifestResponse(source) {
   try {
-    return await fetchManifestResponseFromUrl(manifestUrl);
+    return await fetchManifestResponseFromUrl(source.url);
   } catch (error2) {
-    if (manifestUrl !== VERSIONS_MANIFEST_URL) {
+    if (source.fallbackUrl === void 0) {
       throw error2;
     }
     info2(
-      `Failed to fetch manifest from Astral mirror, falling back to GitHub: ${error2.message}`
+      `Failed to fetch manifest from ${source.url}, falling back to ${source.fallbackUrl}: ${error2.message}`
     );
-    return await fetchManifestResponseFromUrl(GITHUB_VERSIONS_MANIFEST_URL);
+    return await fetchManifestResponseFromUrl(source.fallbackUrl);
   }
 }
 async function fetchManifestResponseFromUrl(manifestUrl) {
@@ -53845,19 +53840,19 @@ async function fetchManifestResponseFromUrl(manifestUrl) {
   }
   return response;
 }
-async function findManifestVersion(predicate) {
-  const cachedManifest = cachedManifestData.get(VERSIONS_MANIFEST_URL);
+async function findManifestVersion(source, predicate) {
+  if (!source.newestFirst) {
+    return (await fetchManifest(source)).find(predicate);
+  }
+  const cachedManifest = cachedManifestData.get(source);
   const cachedVersion = cachedManifest?.versions.find(predicate);
   if (cachedVersion !== void 0 || cachedManifest?.complete === true) {
     return cachedVersion;
   }
-  const response = await fetchManifestResponse(VERSIONS_MANIFEST_URL);
+  const response = await fetchManifestResponse(source);
   if (response.body === null) {
-    const versions2 = parseManifest(
-      await response.text(),
-      VERSIONS_MANIFEST_URL
-    );
-    cachedManifestData.set(VERSIONS_MANIFEST_URL, {
+    const versions2 = parseManifest(await response.text(), source.url);
+    cachedManifestData.set(source, {
       complete: true,
       versions: versions2
     });
@@ -53877,13 +53872,9 @@ async function findManifestVersion(predicate) {
         continue;
       }
       if (versions.length === 0) {
-        rejectLegacyManifest(record, VERSIONS_MANIFEST_URL);
+        rejectLegacyManifest(record, source.url);
       }
-      const versionData = parseManifestRecord(
-        record,
-        VERSIONS_MANIFEST_URL,
-        lineNumber
-      );
+      const versionData = parseManifestRecord(record, source.url, lineNumber);
       versions.push(versionData);
       if (predicate(versionData)) {
         matchedVersion = versionData;
@@ -53898,9 +53889,9 @@ async function findManifestVersion(predicate) {
     }
   }
   if (versions.length === 0) {
-    throw new Error(`Manifest at ${VERSIONS_MANIFEST_URL} is empty.`);
+    throw new Error(`Manifest at ${source.url} is empty.`);
   }
-  cachedManifestData.set(VERSIONS_MANIFEST_URL, { complete, versions });
+  cachedManifestData.set(source, { complete, versions });
   return matchedVersion;
 }
 function parseManifestRecord(record, sourceDescription, lineNumber) {
@@ -53946,6 +53937,16 @@ function isRecord(value) {
   return typeof value === "object" && value !== null;
 }
 
+// src/utils/inputs.ts
+var VERSIONS_MANIFEST_URL = "https://releases.astral.sh/github/versions/main/v1/uv.ndjson";
+var GITHUB_VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
+var ASTRAL_MANIFEST = {
+  custom: false,
+  fallbackUrl: GITHUB_VERSIONS_MANIFEST_URL,
+  newestFirst: true,
+  url: VERSIONS_MANIFEST_URL
+};
+
 // src/update-known-checksums.ts
 async function run() {
   const checksumFilePath = process.argv.slice(2)[0];
@@ -53954,7 +53955,7 @@ async function run() {
       "Missing checksum file path. Usage: node dist/update-known-checksums/index.cjs "
     );
   }
-  const latestVersion = await getLatestVersion();
+  const latestVersion = await getFirstVersion(ASTRAL_MANIFEST);
   const latestKnownVersion = getLatestKnownVersion();
   if (semver2.lte(latestVersion, latestKnownVersion)) {
     info2(
@@ -53962,7 +53963,7 @@ async function run() {
     );
     return;
   }
-  const versions = await fetchManifest();
+  const versions = await fetchManifest(ASTRAL_MANIFEST);
   const checksumEntries = extractChecksumsFromManifest(versions);
   await updateChecksums(checksumFilePath, checksumEntries);
   setOutput("latest-version", latestVersion);
@@ -53989,4 +53990,41 @@ undici/lib/web/fetch/body.js:
 undici/lib/web/websocket/frame.js:
 undici/lib/web/websocket/frame.js:
   (*! ws. MIT License. Einar Otto Stangvik  *)
+
+smol-toml/dist/date.js:
+smol-toml/dist/error.js:
+smol-toml/dist/util.js:
+smol-toml/dist/primitive.js:
+smol-toml/dist/extract.js:
+smol-toml/dist/struct.js:
+smol-toml/dist/parse.js:
+smol-toml/dist/stringify.js:
+smol-toml/dist/index.js:
+  (*!
+   * Copyright (c) Squirrel Chat et al., All rights reserved.
+   * SPDX-License-Identifier: BSD-3-Clause
+   *
+   * Redistribution and use in source and binary forms, with or without
+   * modification, are permitted provided that the following conditions are met:
+   *
+   * 1. Redistributions of source code must retain the above copyright notice, this
+   *    list of conditions and the following disclaimer.
+   * 2. Redistributions in binary form must reproduce the above copyright notice,
+   *    this list of conditions and the following disclaimer in the
+   *    documentation and/or other materials provided with the distribution.
+   * 3. Neither the name of the copyright holder nor the names of its contributors
+   *    may be used to endorse or promote products derived from this software without
+   *    specific prior written permission.
+   *
+   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   *)
 */
diff --git a/docs/customization.md b/docs/customization.md
index 980f43b..c07a303 100644
--- a/docs/customization.md
+++ b/docs/customization.md
@@ -45,10 +45,11 @@ against the same digest. The first run may download uv again.
 By default, setup-uv reads version metadata from
 the [Astral mirror](https://releases.astral.sh/github/versions/main/v1/uv.ndjson).
 If the mirror request fails, it falls back to [`astral-sh/versions`](https://github.com/astral-sh/versions).
+Set `download-from-astral-mirror: false` to fetch the default manifest and uv release archives directly from GitHub.
 
 The `manifest-file` input lets you override that source with your own URL, for example to test
 custom uv builds or alternate download locations. Custom manifest URLs do not fall back to the
-default sources.
+default sources. The mirror setting does not change the custom manifest URL.
 
 ### Format
 
diff --git a/src/download/download-version.ts b/src/download/download-version.ts
index 4ba9e1b..7cc5dda 100644
--- a/src/download/download-version.ts
+++ b/src/download/download-version.ts
@@ -6,15 +6,11 @@ import {
   ASTRAL_MIRROR_PREFIX,
   GITHUB_RELEASES_PREFIX,
   TOOL_CACHE_NAME,
-  VERSIONS_MANIFEST_URL,
 } from "../utils/constants";
 import * as log from "../utils/logging";
 import type { Architecture, Platform } from "../utils/platforms";
 import { validateChecksum } from "./checksum/checksum";
 import { KNOWN_CHECKSUMS } from "./checksum/known-checksums";
-import { getArtifact } from "./manifest";
-
-export { resolveVersion } from "../version/resolve";
 
 export function getIntrinsicChecksum(
   key: string,
@@ -52,27 +48,12 @@ export async function downloadVersion(
   platform: Platform,
   arch: Architecture,
   version: string,
+  artifact: { downloadUrl: string; checksum: string },
   checksum: string | undefined,
   githubToken: string,
-  manifestUrl?: string,
   downloadFromAstralMirror = true,
   toolCacheName = TOOL_CACHE_NAME,
 ): Promise<{ version: string; cachedToolDir: string }> {
-  const artifact = await getArtifact(version, arch, platform, manifestUrl);
-
-  if (!artifact) {
-    throw new Error(
-      getMissingArtifactMessage(version, arch, platform, manifestUrl),
-    );
-  }
-
-  // Custom manifests are explicitly selected by the user, so their checksum
-  // takes precedence over the built-in table. For the default manifest, pass
-  // its checksum as a fallback after user input and KNOWN_CHECKSUMS.
-  const resolvedChecksum =
-    manifestUrl === undefined
-      ? checksum
-      : resolveChecksum(checksum, artifact.checksum);
   const manifestChecksum = artifact.checksum;
 
   const mirrorUrl = downloadFromAstralMirror
@@ -87,7 +68,7 @@ export async function downloadVersion(
       platform,
       arch,
       version,
-      resolvedChecksum,
+      checksum,
       manifestChecksum,
       githubTokenForUrl(downloadUrl, githubToken),
       toolCacheName,
@@ -107,7 +88,7 @@ export async function downloadVersion(
       platform,
       arch,
       version,
-      resolvedChecksum,
+      checksum,
       manifestChecksum,
       githubTokenForUrl(artifact.downloadUrl, githubToken),
       toolCacheName,
@@ -191,28 +172,6 @@ async function downloadArtifact(
   return { cachedToolDir, version };
 }
 
-function getMissingArtifactMessage(
-  version: string,
-  arch: Architecture,
-  platform: Platform,
-  manifestUrl?: string,
-): string {
-  if (manifestUrl === undefined) {
-    return `Could not find artifact for version ${version}, arch ${arch}, platform ${platform} in ${VERSIONS_MANIFEST_URL} .`;
-  }
-
-  return `manifest-file does not contain version ${version}, arch ${arch}, platform ${platform}.`;
-}
-
-function resolveChecksum(
-  checksum: string | undefined,
-  manifestChecksum: string,
-): string {
-  return checksum !== undefined && checksum !== ""
-    ? checksum
-    : manifestChecksum;
-}
-
 function getExtension(platform: Platform): string {
   return platform === "pc-windows-msvc" ? ".zip" : ".tar.gz";
 }
diff --git a/src/download/manifest.ts b/src/download/manifest.ts
index de94f09..9c73961 100644
--- a/src/download/manifest.ts
+++ b/src/download/manifest.ts
@@ -1,11 +1,8 @@
 import { createInterface } from "node:readline";
 import { Readable } from "node:stream";
 import * as core from "@actions/core";
-import {
-  GITHUB_VERSIONS_MANIFEST_URL,
-  VERSIONS_MANIFEST_URL,
-} from "../utils/constants";
 import { fetch } from "../utils/fetch";
+import type { ManifestSource } from "../utils/inputs";
 import * as log from "../utils/logging";
 import { selectDefaultVariant } from "./variant-selection";
 
@@ -33,22 +30,23 @@ interface CachedManifest {
   versions: ManifestVersion[];
 }
 
-const cachedManifestData = new Map();
+// Share cached records for the same source object without keeping that object alive.
+let cachedManifestData = new WeakMap();
 export const MANIFEST_FETCH_ATTEMPTS = 3;
 
 export async function fetchManifest(
-  manifestUrl: string = VERSIONS_MANIFEST_URL,
+  source: ManifestSource,
 ): Promise {
-  const cachedManifest = cachedManifestData.get(manifestUrl);
+  const cachedManifest = cachedManifestData.get(source);
   if (cachedManifest?.complete === true) {
-    core.debug(`Using cached manifest data from ${manifestUrl}`);
+    core.debug(`Using cached manifest data from ${source.url}`);
     return cachedManifest.versions;
   }
 
-  const response = await fetchManifestResponse(manifestUrl);
+  const response = await fetchManifestResponse(source);
   const body = await response.text();
-  const versions = parseManifest(body, manifestUrl);
-  cachedManifestData.set(manifestUrl, { complete: true, versions });
+  const versions = parseManifest(body, source.url);
+  cachedManifestData.set(source, { complete: true, versions });
   return versions;
 }
 
@@ -81,39 +79,32 @@ export function parseManifest(
   return versions;
 }
 
-export async function getLatestVersion(
-  manifestUrl: string = VERSIONS_MANIFEST_URL,
-): Promise {
-  const latestVersion =
-    manifestUrl === VERSIONS_MANIFEST_URL
-      ? (await findManifestVersion(() => true))?.version
-      : (await fetchManifest(manifestUrl))[0]?.version;
+export async function getFirstVersion(source: ManifestSource): Promise {
+  const version = (await findManifestVersion(source, () => true))?.version;
 
-  if (latestVersion === undefined) {
+  if (version === undefined) {
     throw new Error("No versions found in manifest data");
   }
 
-  core.debug(`Latest version from manifest: ${latestVersion}`);
-  return latestVersion;
+  return version;
 }
 
-// The default manifest is guaranteed to be ordered newest-first:
-// https://github.com/astral-sh/versions#format
 export async function getFirstMatchingVersion(
   predicate: (version: string) => boolean,
+  source: ManifestSource,
 ): Promise {
   return (
-    await findManifestVersion((versionData) => predicate(versionData.version))
+    await findManifestVersion(source, (versionData) =>
+      predicate(versionData.version),
+    )
   )?.version;
 }
 
 export async function getAllVersions(
-  manifestUrl: string = VERSIONS_MANIFEST_URL,
+  source: ManifestSource,
 ): Promise {
-  log.info(
-    `Getting available versions from ${manifestSource(manifestUrl)} ...`,
-  );
-  const versions = await fetchManifest(manifestUrl);
+  log.info(`Getting available versions from ${source.url} ...`);
+  const versions = await fetchManifest(source);
   return versions.map((versionData) => versionData.version);
 }
 
@@ -121,16 +112,14 @@ export async function getArtifact(
   version: string,
   arch: string,
   platform: string,
-  manifestUrl: string = VERSIONS_MANIFEST_URL,
+  source: ManifestSource,
 ): Promise {
-  const versionData =
-    manifestUrl === VERSIONS_MANIFEST_URL
-      ? await findManifestVersion((candidate) => candidate.version === version)
-      : (await fetchManifest(manifestUrl)).find(
-          (candidate) => candidate.version === version,
-        );
+  const versionData = await findManifestVersion(
+    source,
+    (candidate) => candidate.version === version,
+  );
   if (!versionData) {
-    core.debug(`Version ${version} not found in manifest ${manifestUrl}`);
+    core.debug(`Version ${version} not found in manifest ${source.url}`);
     return undefined;
   }
 
@@ -160,26 +149,21 @@ export async function getArtifact(
   };
 }
 
-export function clearManifestCache(manifestUrl?: string): void {
-  if (manifestUrl === undefined) {
-    cachedManifestData.clear();
-    return;
-  }
-
-  cachedManifestData.delete(manifestUrl);
+export function clearManifestCache(): void {
+  cachedManifestData = new WeakMap();
 }
 
-async function fetchManifestResponse(manifestUrl: string) {
+async function fetchManifestResponse(source: ManifestSource) {
   try {
-    return await fetchManifestResponseFromUrl(manifestUrl);
+    return await fetchManifestResponseFromUrl(source.url);
   } catch (error) {
-    if (manifestUrl !== VERSIONS_MANIFEST_URL) {
+    if (source.fallbackUrl === undefined) {
       throw error;
     }
     log.info(
-      `Failed to fetch manifest from Astral mirror, falling back to GitHub: ${(error as Error).message}`,
+      `Failed to fetch manifest from ${source.url}, falling back to ${source.fallbackUrl}: ${(error as Error).message}`,
     );
-    return await fetchManifestResponseFromUrl(GITHUB_VERSIONS_MANIFEST_URL);
+    return await fetchManifestResponseFromUrl(source.fallbackUrl);
   }
 }
 
@@ -214,21 +198,25 @@ async function fetchManifestResponseFromUrl(manifestUrl: string) {
 }
 
 async function findManifestVersion(
+  source: ManifestSource,
   predicate: (versionData: ManifestVersion) => boolean,
 ): Promise {
-  const cachedManifest = cachedManifestData.get(VERSIONS_MANIFEST_URL);
+  // The built-in manifests are ordered newest-first:
+  // https://github.com/astral-sh/versions#format
+  if (!source.newestFirst) {
+    return (await fetchManifest(source)).find(predicate);
+  }
+
+  const cachedManifest = cachedManifestData.get(source);
   const cachedVersion = cachedManifest?.versions.find(predicate);
   if (cachedVersion !== undefined || cachedManifest?.complete === true) {
     return cachedVersion;
   }
 
-  const response = await fetchManifestResponse(VERSIONS_MANIFEST_URL);
+  const response = await fetchManifestResponse(source);
   if (response.body === null) {
-    const versions = parseManifest(
-      await response.text(),
-      VERSIONS_MANIFEST_URL,
-    );
-    cachedManifestData.set(VERSIONS_MANIFEST_URL, {
+    const versions = parseManifest(await response.text(), source.url);
+    cachedManifestData.set(source, {
       complete: true,
       versions,
     });
@@ -251,14 +239,10 @@ async function findManifestVersion(
       }
 
       if (versions.length === 0) {
-        rejectLegacyManifest(record, VERSIONS_MANIFEST_URL);
+        rejectLegacyManifest(record, source.url);
       }
 
-      const versionData = parseManifestRecord(
-        record,
-        VERSIONS_MANIFEST_URL,
-        lineNumber,
-      );
+      const versionData = parseManifestRecord(record, source.url, lineNumber);
       versions.push(versionData);
       if (predicate(versionData)) {
         matchedVersion = versionData;
@@ -275,21 +259,13 @@ async function findManifestVersion(
   }
 
   if (versions.length === 0) {
-    throw new Error(`Manifest at ${VERSIONS_MANIFEST_URL} is empty.`);
+    throw new Error(`Manifest at ${source.url} is empty.`);
   }
 
-  cachedManifestData.set(VERSIONS_MANIFEST_URL, { complete, versions });
+  cachedManifestData.set(source, { complete, versions });
   return matchedVersion;
 }
 
-function manifestSource(manifestUrl: string): string {
-  if (manifestUrl === VERSIONS_MANIFEST_URL) {
-    return VERSIONS_MANIFEST_URL;
-  }
-
-  return `manifest-file ${manifestUrl}`;
-}
-
 function parseManifestRecord(
   record: string,
   sourceDescription: string,
diff --git a/src/setup-uv.ts b/src/setup-uv.ts
index f87404a..e441537 100644
--- a/src/setup-uv.ts
+++ b/src/setup-uv.ts
@@ -8,6 +8,7 @@ import {
   getIntrinsicChecksum,
   tryGetFromToolCache,
 } from "./download/download-version";
+import { getArtifact } from "./download/manifest";
 import {
   STATE_UV_PATH,
   STATE_UV_VERSION,
@@ -145,13 +146,16 @@ async function setupUv(
   platform: Platform,
   arch: Architecture,
 ): Promise<{ uvDir: string; version: string }> {
-  const resolvedVersion = await resolveUvVersion({
-    manifestFile: inputs.manifestFile,
-    resolutionStrategy: inputs.resolutionStrategy,
-    version: inputs.version,
-    versionFile: inputs.versionFile,
-    workingDirectory: inputs.workingDirectory,
-  });
+  const { manifestSource } = inputs;
+  const resolvedVersion = await resolveUvVersion(
+    {
+      resolutionStrategy: inputs.resolutionStrategy,
+      version: inputs.version,
+      versionFile: inputs.versionFile,
+      workingDirectory: inputs.workingDirectory,
+    },
+    manifestSource,
+  );
   let checksum = inputs.checksum;
   let toolCacheName = TOOL_CACHE_NAME;
   if (inputs.requireChecksums) {
@@ -175,13 +179,34 @@ async function setupUv(
     };
   }
 
+  const artifact = await getArtifact(
+    resolvedVersion,
+    arch,
+    platform,
+    manifestSource,
+  );
+  if (artifact === undefined) {
+    const target = `version ${resolvedVersion}, arch ${arch}, platform ${platform}`;
+    throw new Error(
+      manifestSource.custom
+        ? `manifest-file does not contain ${target}.`
+        : `Could not find artifact for ${target} in ${manifestSource.url} .`,
+    );
+  }
+
+  // An explicit manifest's checksum takes precedence over the bundled table,
+  // but never over a checksum input or the checksum required above.
+  if (manifestSource.custom) {
+    checksum = checksum || artifact.checksum;
+  }
+
   const downloadResult = await downloadVersion(
     platform,
     arch,
     resolvedVersion,
+    artifact,
     checksum,
     inputs.githubToken,
-    inputs.manifestFile,
     inputs.downloadFromAstralMirror,
     toolCacheName,
   );
diff --git a/src/update-known-checksums.ts b/src/update-known-checksums.ts
index 21479d5..d2f8558 100644
--- a/src/update-known-checksums.ts
+++ b/src/update-known-checksums.ts
@@ -7,9 +7,10 @@ import {
 } from "./download/checksum/update-known-checksums";
 import {
   fetchManifest,
-  getLatestVersion,
+  getFirstVersion,
   type ManifestVersion,
 } from "./download/manifest";
+import { ASTRAL_MANIFEST } from "./utils/inputs";
 import * as log from "./utils/logging";
 
 async function run(): Promise {
@@ -20,7 +21,7 @@ async function run(): Promise {
     );
   }
 
-  const latestVersion = await getLatestVersion();
+  const latestVersion = await getFirstVersion(ASTRAL_MANIFEST);
   const latestKnownVersion = getLatestKnownVersion();
 
   if (semver.lte(latestVersion, latestKnownVersion)) {
@@ -30,7 +31,7 @@ async function run(): Promise {
     return;
   }
 
-  const versions = await fetchManifest();
+  const versions = await fetchManifest(ASTRAL_MANIFEST);
   const checksumEntries = extractChecksumsFromManifest(versions);
   await updateChecksums(checksumFilePath, checksumEntries);
 
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index c84a04b..d32e243 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -1,10 +1,6 @@
 export const TOOL_CACHE_NAME = "uv";
 export const STATE_UV_PATH = "uv-path";
 export const STATE_UV_VERSION = "uv-version";
-export const VERSIONS_MANIFEST_URL =
-  "https://releases.astral.sh/github/versions/main/v1/uv.ndjson";
-export const GITHUB_VERSIONS_MANIFEST_URL =
-  "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
 
 /** GitHub Releases URL prefix for uv artifacts. */
 export const GITHUB_RELEASES_PREFIX =
diff --git a/src/utils/inputs.ts b/src/utils/inputs.ts
index 7c502a2..02cadba 100644
--- a/src/utils/inputs.ts
+++ b/src/utils/inputs.ts
@@ -19,6 +19,30 @@ export interface CacheLocalPath {
 
 export type ResolutionStrategy = "highest" | "lowest";
 
+export interface ManifestSource {
+  readonly url: string;
+  readonly newestFirst: boolean;
+  readonly fallbackUrl?: string;
+  readonly custom: boolean;
+}
+
+const VERSIONS_MANIFEST_URL =
+  "https://releases.astral.sh/github/versions/main/v1/uv.ndjson";
+const GITHUB_VERSIONS_MANIFEST_URL =
+  "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
+
+export const ASTRAL_MANIFEST: ManifestSource = {
+  custom: false,
+  fallbackUrl: GITHUB_VERSIONS_MANIFEST_URL,
+  newestFirst: true,
+  url: VERSIONS_MANIFEST_URL,
+};
+const GITHUB_MANIFEST: ManifestSource = {
+  custom: false,
+  newestFirst: true,
+  url: GITHUB_VERSIONS_MANIFEST_URL,
+};
+
 export interface SetupInputs {
   workingDirectory: string;
   version: string;
@@ -45,7 +69,7 @@ export interface SetupInputs {
   toolDir?: string;
   pythonDir: string;
   githubToken: string;
-  manifestFile?: string;
+  manifestSource: ManifestSource;
   downloadFromAstralMirror: boolean;
   addProblemMatchers: boolean;
   quiet: boolean;
@@ -84,9 +108,9 @@ export function loadInputs(): SetupInputs {
   const toolDir = getToolDir(workingDirectory);
   const pythonDir = getUvPythonDir();
   const githubToken = core.getInput("github-token");
-  const manifestFile = getManifestFile();
   const downloadFromAstralMirror =
     core.getInput("download-from-astral-mirror") === "true";
+  const manifestSource = getManifestSource(downloadFromAstralMirror);
   const addProblemMatchers = core.getInput("add-problem-matchers") === "true";
   const quiet = core.getInput("quiet") === "true";
   const resolutionStrategy = getResolutionStrategy();
@@ -105,7 +129,7 @@ export function loadInputs(): SetupInputs {
     githubToken,
     ignoreEmptyWorkdir,
     ignoreNothingToCache,
-    manifestFile,
+    manifestSource,
     noProject,
     pruneCache,
     pythonArch,
@@ -384,12 +408,12 @@ function resolveRelativePath(
   return hasNegation ? `!${resolvedPath}` : resolvedPath;
 }
 
-function getManifestFile(): string | undefined {
-  const manifestFileInput = core.getInput("manifest-file");
-  if (manifestFileInput !== "") {
-    return manifestFileInput;
+function getManifestSource(useAstralMirror: boolean): ManifestSource {
+  const manifestFile = core.getInput("manifest-file");
+  if (manifestFile !== "") {
+    return { custom: true, newestFirst: false, url: manifestFile };
   }
-  return undefined;
+  return useAstralMirror ? ASTRAL_MANIFEST : GITHUB_MANIFEST;
 }
 
 function getResolutionStrategy(): ResolutionStrategy {
diff --git a/src/version/resolve.ts b/src/version/resolve.ts
index 1654be5..e800c8f 100644
--- a/src/version/resolve.ts
+++ b/src/version/resolve.ts
@@ -6,10 +6,9 @@ import { getLatestKnownVersion } from "../download/checksum/known-version";
 import {
   getAllVersions,
   getFirstMatchingVersion,
-  getLatestVersion,
+  getFirstVersion,
 } from "../download/manifest";
-import { VERSIONS_MANIFEST_URL } from "../utils/constants";
-import type { ResolutionStrategy } from "../utils/inputs";
+import type { ManifestSource, ResolutionStrategy } from "../utils/inputs";
 import * as log from "../utils/logging";
 import {
   type ParsedVersionSpecifier,
@@ -19,7 +18,7 @@ import type { ResolveUvVersionOptions } from "./types";
 import { resolveVersionRequest } from "./version-request-resolver";
 
 interface ConcreteVersionResolutionContext {
-  manifestUrl?: string;
+  source: ManifestSource;
   parsedSpecifier: ParsedVersionSpecifier;
   resolutionStrategy: ResolutionStrategy;
 }
@@ -66,7 +65,7 @@ class LatestVersionResolver implements ConcreteVersionResolver {
       log.info("Found minimum version specifier, using latest version");
     }
 
-    const latestVersion = await getLatestVersion(context.manifestUrl);
+    const latestVersion = await getFirstVersion(context.source);
 
     if (
       context.parsedSpecifier.kind === "range" &&
@@ -91,14 +90,14 @@ class RangeVersionResolver implements ConcreteVersionResolver {
     let resolvedVersion: string | undefined;
     if (
       context.resolutionStrategy === "highest" &&
-      (context.manifestUrl === undefined ||
-        context.manifestUrl === VERSIONS_MANIFEST_URL)
+      context.source.newestFirst
     ) {
       resolvedVersion = await findHighestSatisfyingVersion(
         context.parsedSpecifier.normalized,
+        context.source,
       );
     } else {
-      const availableVersions = await getAllVersions(context.manifestUrl);
+      const availableVersions = await getAllVersions(context.source);
       core.debug(`Available versions: ${availableVersions}`);
       resolvedVersion =
         context.resolutionStrategy === "lowest"
@@ -125,12 +124,13 @@ const CONCRETE_VERSION_RESOLVERS: ConcreteVersionResolver[] = [
 
 export async function resolveUvVersion(
   options: ResolveUvVersionOptions,
+  source: ManifestSource,
 ): Promise {
   const request = resolveVersionRequest(options);
   const resolutionStrategy = options.resolutionStrategy ?? "highest";
   const version = await resolveVersion(
     request.specifier,
-    options.manifestFile,
+    source,
     resolutionStrategy,
   );
 
@@ -139,7 +139,7 @@ export async function resolveUvVersion(
 
 export async function resolveVersion(
   versionInput: string,
-  manifestUrl: string | undefined,
+  source: ManifestSource,
   resolutionStrategy: ResolutionStrategy = "highest",
 ): Promise {
   core.debug(`Resolving version: ${versionInput}`);
@@ -149,9 +149,9 @@ export async function resolveVersion(
   }
 
   const context: ConcreteVersionResolutionContext = {
-    manifestUrl,
     parsedSpecifier: parseVersionSpecifier(versionInput),
     resolutionStrategy,
+    source,
   };
 
   for (const resolver of CONCRETE_VERSION_RESOLVERS) {
@@ -166,15 +166,16 @@ export async function resolveVersion(
 
 async function findHighestSatisfyingVersion(
   versionSpecifier: string,
+  source: ManifestSource,
 ): Promise {
-  // This fast path assumes uv releases are semver-monotonic: newer manifest
-  // entries always have higher versions, with no lower-version backports.
+  // The built-in manifest sources list uv releases in descending order.
   const semverRange = isPep440Specifier(versionSpecifier)
     ? null
     : semver.validRange(versionSpecifier);
   if (semverRange !== null) {
-    const semverMatch = await getFirstMatchingVersion((version) =>
-      semver.satisfies(version, semverRange),
+    const semverMatch = await getFirstMatchingVersion(
+      (version) => semver.satisfies(version, semverRange),
+      source,
     );
     if (semverMatch !== undefined) {
       core.debug(
@@ -184,8 +185,9 @@ async function findHighestSatisfyingVersion(
     }
   }
 
-  const pep440Match = await getFirstMatchingVersion((version) =>
-    pep440.satisfies(version, versionSpecifier),
+  const pep440Match = await getFirstMatchingVersion(
+    (version) => pep440.satisfies(version, versionSpecifier),
+    source,
   );
   if (pep440Match !== undefined) {
     core.debug(
diff --git a/src/version/types.ts b/src/version/types.ts
index 4ccefdd..e1ce9d2 100644
--- a/src/version/types.ts
+++ b/src/version/types.ts
@@ -20,7 +20,6 @@ export interface ParsedVersionFile {
 }
 
 export interface ResolveUvVersionOptions {
-  manifestFile?: string;
   resolutionStrategy?: ResolutionStrategy;
   version?: string;
   versionFile?: string;