Remove deprecrated custom manifest (#813)
Some checks failed
CodeQL / Analyze (TypeScript) (push) Failing after 6s
test / lint (push) Failing after 5s
test / test-default-version (ubuntu-latest) (push) Failing after 5s
test / test-uv-no-modify-path (push) Failing after 5s
test / test-specific-version (map[expected-version:0.1.0 resolution-strategy:lowest version-input:>=0.1.0,<0.2]) (push) Failing after 5s
test / test-specific-version (map[expected-version:0.1.45 resolution-strategy:highest version-input:>=0.1,<0.2]) (push) Failing after 5s
test / test-specific-version (map[expected-version:0.3.0 version-input:0.3.0]) (push) Failing after 5s
test / test-specific-version (map[expected-version:0.3.2 version-input:0.3.2]) (push) Failing after 4s
test / test-specific-version (map[expected-version:0.3.5 version-input:0.3.x]) (push) Failing after 4s
test / test-specific-version (map[expected-version:0.3.5 version-input:0.3]) (push) Failing after 5s
test / test-specific-version (map[expected-version:0.4.25 resolution-strategy:lowest version-input:>=0.4.25,<0.5]) (push) Failing after 7s
test / test-specific-version (map[expected-version:0.4.25 resolution-strategy:lowest version-input:>=0.4.25]) (push) Failing after 7s
test / test-specific-version (map[expected-version:0.4.30 version-input:>=0.4.25,<0.5]) (push) Failing after 8s
test / test-latest-version (>=0.8) (push) Failing after 8s
test / test-latest-version (latest) (push) Failing after 8s
test / test-from-working-directory-version (map[expected-version:0.5.14 working-directory:__tests__/fixtures/pyproject-toml-project]) (push) Failing after 9s
test / test-from-working-directory-version (map[expected-version:0.5.15 working-directory:__tests__/fixtures/uv-toml-project]) (push) Failing after 9s
test / test-version-file-version (map[expected-version:0.5.15 version-file:__tests__/fixtures/.tool-versions]) (push) Failing after 9s
test / test-version-file-version (map[expected-version:0.6.17 version-file:__tests__/fixtures/uv-in-requirements-txt-project/requirements.txt]) (push) Failing after 8s
test / test-version-file-version (map[expected-version:0.8.3 version-file:__tests__/fixtures/uv-in-requirements-hash-txt-project/requirements.txt]) (push) Failing after 9s
test / test-malformed-pyproject-file-fallback (push) Failing after 9s
test / test-checksum (map[checksum:4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd os:ubuntu-latest]) (push) Failing after 9s
test / test-with-explicit-token (push) Failing after 9s
test / test-uvx (push) Failing after 9s
test / test-tool-install (ubuntu-latest) (push) Failing after 9s
test / test-python-version (ubuntu-latest) (push) Failing after 9s
test / test-activate-environment (ubuntu-latest) (push) Failing after 9s
test / test-activate-environment-custom-path (ubuntu-latest) (push) Failing after 10s
test / test-cache-key-os-version (ubuntu-22.04, ubuntu-22.04) (push) Failing after 8s
test / test-setup-cache (auto, ubuntu-latest) (push) Failing after 8s
test / test-setup-cache (false, ubuntu-latest) (push) Failing after 8s
test / test-setup-cache (true, ubuntu-latest) (push) Failing after 7s
test / test-setup-cache-requirements-txt (push) Failing after 7s
test / test-restore-cache-requirements-txt (push) Has been skipped
test / test-setup-cache-dependency-glob (push) Failing after 8s
test / test-musl (push) Failing after 16s
test / test-restore-cache-dependency-glob (push) Has been skipped
test / test-setup-cache-save-cache-false (push) Failing after 10s
test / test-restore-cache-save-cache-false (push) Has been skipped
test / test-restore-cache-restore-cache-false (push) Has been skipped
test / test-setup-cache-restore-cache-false (push) Failing after 10s
test / test-cache-local (map[expected-cache-dir:/home/runner/work/_temp/setup-uv-cache os:ubuntu-latest]) (push) Failing after 10s
test / test-cache-local-cache-disabled (push) Failing after 10s
test / test-cache-local-cache-disabled-but-explicit-path (push) Failing after 9s
test / test-no-python-version (push) Failing after 9s
test / test-custom-manifest-file (push) Failing after 10s
test / test-absolute-path (push) Failing after 10s
test / test-relative-path (push) Failing after 10s
test / test-cache-prune-force (push) Failing after 10s
test / test-cache-dir-from-file (push) Failing after 10s
test / test-cache-python-missing-managed-install-dir (push) Failing after 10s
test / test-cache-python-installs (push) Failing after 10s
test / test-restore-python-installs (push) Has been skipped
test / test-python-install-dir (map[expected-python-dir:/home/runner/work/_temp/uv-python-dir os:ubuntu-latest]) (push) Failing after 10s
test / test-act (push) Failing after 10s
test / validate-typings (push) Failing after 10s
test / test-debian-unstable (push) Failing after 48s
Release Drafter / ✏️ Draft release (push) Has been cancelled
test / test-default-version (macos-14) (push) Has been cancelled
test / test-default-version (macos-latest) (push) Has been cancelled
test / test-default-version (windows-latest) (push) Has been cancelled
test / test-checksum (map[checksum:a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218 os:macos-latest]) (push) Has been cancelled
test / test-tool-install (macos-14) (push) Has been cancelled
test / test-tool-install (macos-latest) (push) Has been cancelled
test / test-tool-install (windows-latest) (push) Has been cancelled
test / test-python-version (macos-latest) (push) Has been cancelled
test / test-python-version (windows-latest) (push) Has been cancelled
test / test-activate-environment (macos-latest) (push) Has been cancelled
test / test-activate-environment (windows-latest) (push) Has been cancelled
test / test-activate-environment-custom-path (macos-latest) (push) Has been cancelled
test / test-cache-key-os-version (macos-14, macos-14) (push) Has been cancelled
test / test-cache-key-os-version (macos-15, macos-15) (push) Has been cancelled
test / test-cache-key-os-version (ubuntu-24.04, ubuntu-24.04) (push) Has been cancelled
test / test-cache-key-os-version (windows-2022, windows-2022) (push) Has been cancelled
test / test-cache-key-os-version (windows-2025, windows-2025) (push) Has been cancelled
test / test-setup-cache (auto, windows-latest) (push) Has been cancelled
test / test-setup-cache (false, windows-latest) (push) Has been cancelled
test / test-setup-cache (true, windows-latest) (push) Has been cancelled
test / test-restore-cache (auto, ubuntu-latest) (push) Has been cancelled
test / test-restore-cache (auto, windows-latest) (push) Has been cancelled
test / test-restore-cache (false, ubuntu-latest) (push) Has been cancelled
test / test-restore-cache (false, windows-latest) (push) Has been cancelled
test / all-tests-passed (push) Has been cancelled
test / test-activate-environment-custom-path (windows-latest) (push) Has been cancelled
test / test-restore-cache (true, ubuntu-latest) (push) Has been cancelled
test / test-restore-cache (true, windows-latest) (push) Has been cancelled
test / test-cache-local (map[expected-cache-dir:D:\a\_temp\setup-uv-cache os:windows-latest]) (push) Has been cancelled
test / test-python-install-dir (map[expected-python-dir:D:\a\_temp\uv-python-dir os:windows-latest]) (push) Has been cancelled
Update known checksums / build (push) Has been cancelled

This commit is contained in:
Kevin Stillhammer
2026-03-23 09:15:51 +01:00
committed by GitHub
parent 8cc8d1cbfc
commit 89709315bb
20 changed files with 736 additions and 1336 deletions

View File

@@ -19064,8 +19064,8 @@ var require_semver = __commonJS({
return exports2.compareBuild(b, a, loose);
});
}
exports2.gt = gt;
function gt(a, b, loose) {
exports2.gt = gt2;
function gt2(a, b, loose) {
return compare(a, b, loose) > 0;
}
exports2.lt = lt;
@@ -19110,7 +19110,7 @@ var require_semver = __commonJS({
case "!=":
return neq(a, b, loose);
case ">":
return gt(a, b, loose);
return gt2(a, b, loose);
case ">=":
return gte(a, b, loose);
case "<":
@@ -19608,7 +19608,7 @@ var require_semver = __commonJS({
/* fallthrough */
case "":
case ">=":
if (!minver || gt(minver, compver)) {
if (!minver || gt2(minver, compver)) {
minver = compver;
}
break;
@@ -19649,7 +19649,7 @@ var require_semver = __commonJS({
var gtfn, ltefn, ltfn, comp, ecomp;
switch (hilo) {
case ">":
gtfn = gt;
gtfn = gt2;
ltefn = lte2;
ltfn = lt;
comp = ">";
@@ -19658,7 +19658,7 @@ var require_semver = __commonJS({
case "<":
gtfn = lt;
ltefn = gte;
ltfn = gt;
ltfn = gt2;
comp = "<";
ecomp = "<=";
break;
@@ -44945,7 +44945,7 @@ function info(message) {
}
// src/update-known-checksums.ts
var semver = __toESM(require_semver(), 1);
var semver2 = __toESM(require_semver(), 1);
// src/download/checksum/known-checksums.ts
var KNOWN_CHECKSUMS = {
@@ -49410,8 +49410,11 @@ async function updateChecksums(filePath, checksumEntries) {
await import_node_fs.promises.writeFile(filePath, content);
}
// src/download/manifest.ts
var semver = __toESM(require_semver(), 1);
// src/utils/constants.ts
var VERSIONS_NDJSON_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
var 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);
@@ -49431,72 +49434,87 @@ var fetch = async (url, opts) => await (0, import_undici2.fetch)(url, {
...opts
});
// src/download/versions-client.ts
var cachedVersionData = /* @__PURE__ */ new Map();
async function fetchVersionData(url = VERSIONS_NDJSON_URL) {
const cachedVersions = cachedVersionData.get(url);
// src/download/manifest.ts
var cachedManifestData = /* @__PURE__ */ new Map();
async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) {
const cachedVersions = cachedManifestData.get(manifestUrl);
if (cachedVersions !== void 0) {
debug(`Using cached NDJSON version data from ${url}`);
debug(`Using cached manifest data from ${manifestUrl}`);
return cachedVersions;
}
info(`Fetching version data from ${url} ...`);
const response = await fetch(url, {});
info(`Fetching manifest data from ${manifestUrl} ...`);
const response = await fetch(manifestUrl, {});
if (!response.ok) {
throw new Error(
`Failed to fetch version data: ${response.status} ${response.statusText}`
`Failed to fetch manifest data: ${response.status} ${response.statusText}`
);
}
const body = await response.text();
const versions = parseVersionData(body, url);
cachedVersionData.set(url, versions);
const versions = parseManifest(body, manifestUrl);
cachedManifestData.set(manifestUrl, versions);
return versions;
}
function parseVersionData(data, sourceDescription) {
function parseManifest(data, sourceDescription) {
const trimmed = data.trim();
if (trimmed === "") {
throw new Error(`Manifest at ${sourceDescription} is empty.`);
}
if (trimmed.startsWith("[")) {
throw new Error(
`Legacy JSON array manifests are no longer supported in ${sourceDescription}. Use the astral-sh/versions manifest format instead.`
);
}
const versions = [];
for (const [index, line] of data.split("\n").entries()) {
const trimmed = line.trim();
if (trimmed === "") {
const record = line.trim();
if (record === "") {
continue;
}
let parsed;
try {
parsed = JSON.parse(trimmed);
parsed = JSON.parse(record);
} catch (error) {
throw new Error(
`Failed to parse version data from ${sourceDescription} at line ${index + 1}: ${error.message}`
`Failed to parse manifest data from ${sourceDescription} at line ${index + 1}: ${error.message}`
);
}
if (!isNdjsonVersion(parsed)) {
if (!isManifestVersion(parsed)) {
throw new Error(
`Invalid NDJSON record in ${sourceDescription} at line ${index + 1}.`
`Invalid manifest record in ${sourceDescription} at line ${index + 1}.`
);
}
versions.push(parsed);
}
if (versions.length === 0) {
throw new Error(`No version data found in ${sourceDescription}.`);
throw new Error(`No manifest data found in ${sourceDescription}.`);
}
return versions;
}
async function getLatestVersion() {
const versions = await fetchVersionData();
const latestVersion = versions[0]?.version;
if (!latestVersion) {
throw new Error("No versions found in NDJSON data");
async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) {
const versions = await fetchManifest(manifestUrl);
const [firstVersion, ...remainingVersions] = versions.map(
(versionData) => versionData.version
);
if (firstVersion === void 0) {
throw new Error("No versions found in manifest data");
}
debug(`Latest version from NDJSON: ${latestVersion}`);
const latestVersion = remainingVersions.reduce(
(latest, current) => semver.gt(current, latest) ? current : latest,
firstVersion
);
debug(`Latest version from manifest: ${latestVersion}`);
return latestVersion;
}
function isNdjsonVersion(value) {
function isManifestVersion(value) {
if (!isRecord(value)) {
return false;
}
if (typeof value.version !== "string" || !Array.isArray(value.artifacts)) {
return false;
}
return value.artifacts.every(isNdjsonArtifact);
return value.artifacts.every(isManifestArtifact);
}
function isNdjsonArtifact(value) {
function isManifestArtifact(value) {
if (!isRecord(value)) {
return false;
}
@@ -49518,14 +49536,14 @@ async function run() {
}
const latestVersion = await getLatestVersion();
const latestKnownVersion = getLatestKnownVersionFromChecksums();
if (semver.lte(latestVersion, latestKnownVersion)) {
if (semver2.lte(latestVersion, latestKnownVersion)) {
info(
`Latest release (${latestVersion}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.`
);
return;
}
const versions = await fetchVersionData();
const checksumEntries = extractChecksumsFromNdjson(versions);
const versions = await fetchManifest();
const checksumEntries = extractChecksumsFromManifest(versions);
await updateChecksums(checksumFilePath, checksumEntries);
setOutput("latest-version", latestVersion);
}
@@ -49537,7 +49555,7 @@ function getLatestKnownVersionFromChecksums() {
versions.add(version);
}
}
const latestVersion = [...versions].sort(semver.rcompare)[0];
const latestVersion = [...versions].sort(semver2.rcompare)[0];
if (!latestVersion) {
throw new Error("Could not determine latest known version from checksums.");
}
@@ -49546,7 +49564,7 @@ function getLatestKnownVersionFromChecksums() {
function extractVersionFromChecksumKey(key) {
return key.match(VERSION_IN_CHECKSUM_KEY_PATTERN)?.[1];
}
function extractChecksumsFromNdjson(versions) {
function extractChecksumsFromManifest(versions) {
const checksums = [];
for (const version of versions) {
for (const artifact of version.artifacts) {