mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-11-05 01:35:32 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50fa1fece9 |
@@ -59,7 +59,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
uses: github/codeql-action/autobuild@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
Vendored
-87
@@ -1,87 +0,0 @@
|
||||
import { mkdtempSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import {
|
||||
afterAll,
|
||||
beforeEach,
|
||||
describe,
|
||||
expect,
|
||||
it,
|
||||
jest,
|
||||
} from "@jest/globals";
|
||||
import { CacheLocalSource, type SetupInputs } from "../../src/utils/inputs";
|
||||
import { createSetupInputs } from "../helpers/setup-inputs";
|
||||
|
||||
const mockSaveCache = jest.fn<() => Promise<number>>();
|
||||
const mockInfo = jest.fn();
|
||||
const mockLoadInputs = jest.fn<() => SetupInputs>(() =>
|
||||
createSetupInputs({ enableCache: false }),
|
||||
);
|
||||
const state: Record<string, string> = {};
|
||||
|
||||
jest.unstable_mockModule("@actions/cache", () => ({
|
||||
saveCache: mockSaveCache,
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule("@actions/core", () => ({
|
||||
getState: jest.fn((name: string) => state[name] ?? ""),
|
||||
setFailed: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule("../../src/utils/inputs", () => ({
|
||||
loadInputs: mockLoadInputs,
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule("../../src/utils/logging", () => ({
|
||||
info: mockInfo,
|
||||
warning: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.spyOn(process, "exit").mockImplementation((() => undefined) as never);
|
||||
|
||||
const { run } = await import("../../src/save-cache");
|
||||
|
||||
const cacheDir = mkdtempSync(join(tmpdir(), "setup-uv-save-cache-"));
|
||||
const cacheKey = "setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.12-hash";
|
||||
|
||||
function infoMessages(): string[] {
|
||||
return mockInfo.mock.calls.map(([msg]) => msg as string);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
delete process.env.UV_CACHE_DIR;
|
||||
state["cache-key"] = cacheKey;
|
||||
state["cache-matched-key"] = "";
|
||||
mockLoadInputs.mockReturnValue(
|
||||
createSetupInputs({
|
||||
cacheLocalPath: { path: cacheDir, source: CacheLocalSource.Input },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
rmSync(cacheDir, { force: true, recursive: true });
|
||||
});
|
||||
|
||||
describe("saveCache", () => {
|
||||
it("reports the saved key when the cache is saved", async () => {
|
||||
mockSaveCache.mockResolvedValue(42);
|
||||
|
||||
await run();
|
||||
|
||||
expect(mockSaveCache).toHaveBeenCalledWith([cacheDir], cacheKey);
|
||||
expect(infoMessages()).toContain(`uv cache saved with key: ${cacheKey}`);
|
||||
});
|
||||
|
||||
it("does not report the cache as saved when saving fails", async () => {
|
||||
// @actions/cache logs the failure itself and returns -1
|
||||
mockSaveCache.mockResolvedValue(-1);
|
||||
|
||||
await run();
|
||||
|
||||
expect(mockSaveCache).toHaveBeenCalledWith([cacheDir], cacheKey);
|
||||
expect(infoMessages()).not.toContain(
|
||||
`uv cache saved with key: ${cacheKey}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -146,28 +146,6 @@ describe("download-version", () => {
|
||||
expect(mockGetAllVersions).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("resolves ~= with PEP 440 compatible release semantics", async () => {
|
||||
mockGetFirstMatchingVersion.mockImplementation(
|
||||
(predicate: (version: string) => boolean) =>
|
||||
["1.0.0", "0.10.2", "0.9.26"].find(predicate),
|
||||
);
|
||||
|
||||
const version = await resolveVersion("~=0.9", undefined);
|
||||
|
||||
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"]);
|
||||
|
||||
const version = await resolveVersion(
|
||||
"~=0.9",
|
||||
"https://example.com/custom.ndjson",
|
||||
);
|
||||
|
||||
expect(version).toBe("0.10.2");
|
||||
});
|
||||
|
||||
it("treats == exact pins as explicit versions", async () => {
|
||||
const version = await resolveVersion("==0.9.26", undefined);
|
||||
|
||||
|
||||
@@ -35,14 +35,3 @@ test("strips PEP 508 markers from requirements dependencies", () => {
|
||||
|
||||
expect(parsedVersion).toBe("==0.11.20");
|
||||
});
|
||||
|
||||
test.each([
|
||||
["uv >= 0.5.0", ">=0.5.0"],
|
||||
["uv == 0.11.20", "==0.11.20"],
|
||||
["uv>=0.5.0, <0.6.0", ">=0.5.0,<0.6.0"],
|
||||
["uv >= 0.5.0 , < 0.6.0", ">=0.5.0,<0.6.0"],
|
||||
["uv==0.11.20 --hash=sha256:abc", "==0.11.20"],
|
||||
["uv==0.11.20 # pinned for CI", "==0.11.20"],
|
||||
])("allows whitespace in the uv specifier %s", (dependency, expected) => {
|
||||
expect(getUvVersionFromRequirementsText(dependency)).toBe(expected);
|
||||
});
|
||||
|
||||
+2
-4
@@ -66671,10 +66671,8 @@ async function saveCacheToKey(cacheKey, cachePath, stateKey, cacheName) {
|
||||
return;
|
||||
}
|
||||
info2(`Including ${cacheName} path: ${cachePath}`);
|
||||
const cacheId = await saveCache2([cachePath], cacheKey);
|
||||
if (cacheId !== -1) {
|
||||
info2(`${cacheName} saved with key: ${cacheKey}`);
|
||||
}
|
||||
await saveCache2([cachePath], cacheKey);
|
||||
info2(`${cacheName} saved with key: ${cacheKey}`);
|
||||
}
|
||||
__name(saveCacheToKey, "saveCacheToKey");
|
||||
run();
|
||||
|
||||
+4
-7
@@ -101579,7 +101579,7 @@ function getUvVersionFromAllDependencies(allDependencies) {
|
||||
}
|
||||
function getUvVersionFromDependency(dependency) {
|
||||
const dependencyWithoutMarker = dependency.split(";", 1)[0]?.trim();
|
||||
return dependencyWithoutMarker?.match(/^uv\s*((?:[=<>~!]+\s*[^\s,]+\s*,?\s*)+)/)?.[1].replace(/\s/g, "");
|
||||
return dependencyWithoutMarker?.match(/^uv([=<>~!]+\S*)/)?.[1].trim();
|
||||
}
|
||||
|
||||
// src/version/tool-versions-file.ts
|
||||
@@ -101937,7 +101937,7 @@ async function resolveVersion(versionInput, manifestUrl, resolutionStrategy = "h
|
||||
throw new Error(`No version found for ${versionInput}`);
|
||||
}
|
||||
async function findHighestSatisfyingVersion(versionSpecifier) {
|
||||
const semverRange = isCompatibleReleaseSpecifier(versionSpecifier) ? null : semver5.validRange(versionSpecifier);
|
||||
const semverRange = semver5.validRange(versionSpecifier);
|
||||
if (semverRange !== null) {
|
||||
const semverMatch = await getFirstMatchingVersion(
|
||||
(version3) => semver5.satisfies(version3, semverRange)
|
||||
@@ -101959,11 +101959,8 @@ async function findHighestSatisfyingVersion(versionSpecifier) {
|
||||
}
|
||||
return pep440Match;
|
||||
}
|
||||
function isCompatibleReleaseSpecifier(versionSpecifier) {
|
||||
return versionSpecifier.includes("~=");
|
||||
}
|
||||
function maxSatisfying2(versions, version3) {
|
||||
const maxSemver = isCompatibleReleaseSpecifier(version3) ? "" : evaluateVersions(versions, version3);
|
||||
const maxSemver = evaluateVersions(versions, version3);
|
||||
if (maxSemver !== "") {
|
||||
debug(`Found a version that satisfies the semver range: ${maxSemver}`);
|
||||
return maxSemver;
|
||||
@@ -101978,7 +101975,7 @@ function maxSatisfying2(versions, version3) {
|
||||
return void 0;
|
||||
}
|
||||
function minSatisfying3(versions, version3) {
|
||||
const minSemver = isCompatibleReleaseSpecifier(version3) ? null : semver5.minSatisfying(versions, version3);
|
||||
const minSemver = semver5.minSatisfying(versions, version3);
|
||||
if (minSemver !== null) {
|
||||
debug(`Found a version that satisfies the semver range: ${minSemver}`);
|
||||
return minSemver;
|
||||
|
||||
Generated
+83
-71
@@ -20,7 +20,7 @@
|
||||
"undici": "^8.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.5.11",
|
||||
"@biomejs/biome": "^2.5.14",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^26.4.0",
|
||||
"@types/semver": "^7.8.0",
|
||||
@@ -912,9 +912,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@biomejs/biome": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.11.tgz",
|
||||
"integrity": "sha512-Tj0dnkLPdW0ASjHfj2D/ZkkvPU2wrFmnE1jWTD2xzV1ycapV1DutbYXk4NDnR3rYTi1ZCbNFD4G2gRMEY65WaA==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.14.tgz",
|
||||
"integrity": "sha512-0FabLIjd4M/dm8VFI86RMaLLdgepzbdfiAL2R8cr7V81OYYrP1w7Z73KfAwPK5h9SrEBXTzNG2y+mBwPo9xRnw==",
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"bin": {
|
||||
@@ -928,20 +928,20 @@
|
||||
"url": "https://opencollective.com/biome"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@biomejs/cli-darwin-arm64": "2.5.11",
|
||||
"@biomejs/cli-darwin-x64": "2.5.11",
|
||||
"@biomejs/cli-linux-arm64": "2.5.11",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.5.11",
|
||||
"@biomejs/cli-linux-x64": "2.5.11",
|
||||
"@biomejs/cli-linux-x64-musl": "2.5.11",
|
||||
"@biomejs/cli-win32-arm64": "2.5.11",
|
||||
"@biomejs/cli-win32-x64": "2.5.11"
|
||||
"@biomejs/cli-darwin-arm64": "2.5.14",
|
||||
"@biomejs/cli-darwin-x64": "2.5.14",
|
||||
"@biomejs/cli-linux-arm64": "2.5.14",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.5.14",
|
||||
"@biomejs/cli-linux-x64": "2.5.14",
|
||||
"@biomejs/cli-linux-x64-musl": "2.5.14",
|
||||
"@biomejs/cli-win32-arm64": "2.5.14",
|
||||
"@biomejs/cli-win32-x64": "2.5.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.11.tgz",
|
||||
"integrity": "sha512-6SGZxoKbXvUjMn1t6A98HqWISPnGNbYs0R/Rt2JarmXBSev+lva4QxUMWEBX9lX1Wo1XTJ78uk5xVDtG58SRZg==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.14.tgz",
|
||||
"integrity": "sha512-UnzaXO65L4tsZimFITFP2M121GyhDcWFrT3pL5ZJ5U4XcS/0L5VHYytVohdCf/gnDUFHgl2I9xnt5bV/J1kxHQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -956,9 +956,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-x64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.11.tgz",
|
||||
"integrity": "sha512-nYkXY7tLBEgnGbYapDKAyKzgt44ZEyG+AKalvTXtCWKYgepI9dw327q+cVgedxm+Udi1ZzHKUyZrIusHi/KQbw==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.14.tgz",
|
||||
"integrity": "sha512-kiy8qA16K93J7uvFfWi4LgjqDpnRKyePAna6A0Y4jxyUga35SYpIZ2cNWlhy0lsfgqRenCpfymnJWEZ6mgpRgA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -973,13 +973,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.11.tgz",
|
||||
"integrity": "sha512-3PVLSTD9RR73rvVPt5G3T1gc+ycggWEGfTD7RvzzbtcDPD27NxgxBbAFfpm7DXJKW6VLHWE1lLMGvFt2Qxjcow==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.14.tgz",
|
||||
"integrity": "sha512-vO/9BaU1n30CiFNLx49gMTMtbCAAqlo/EqFoG0BU3deQInTbJrmXSmTQ9e3FoDZIKQnvSLDVNL4lx1ci7y1T1Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -990,13 +993,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.11.tgz",
|
||||
"integrity": "sha512-qhyZUMyCbWYFV2bAwRNVvfMVZ+hv7WYl6mossGrxC+uiQQXhvsuWWU8zz6jYX0mChZd9MgQZbm4vozTmG/5iGw==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.14.tgz",
|
||||
"integrity": "sha512-SJ9PrZkBnnH9dHJDnxk34vKs0GB2dbsioaft6/hPhWJ7AHpwYH83Isnhj0FSRpFkGgpVfJ1lds23ApB2czUDLQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1007,13 +1013,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.11.tgz",
|
||||
"integrity": "sha512-JOytptlsgM33B2MMFUg8iBrb4IKpbD5JnJrSeYiaFEeAj4vuXx0iQSQZ4qK7sqyMtfjZxxPdNdMZZVL4y/mFyA==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.14.tgz",
|
||||
"integrity": "sha512-VHZRa7CCQBUWKxNwUvHJeuW03WFRgN5NWO//SDGOitc9QIeNyfA42V9zlKm+x82xFSG9Bzi5fi+hbhm9anO8yA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1024,13 +1033,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.11.tgz",
|
||||
"integrity": "sha512-oRRlrchG5EfrEL/EmtT1qUjSNHk3/5LGeZhQqADBBAJF1b1ET6964xEKe7aGlGARzDfza8H/seEsFJl7S6Ql9w==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.14.tgz",
|
||||
"integrity": "sha512-2kI5PrMgW5dcEZYrstLPmUmCwkUwZY39rP4BN93Vxbwcs2O57LDQOktUZZYPvvspN5i0mhGr3TJtF5sU26NUWg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1041,9 +1053,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-arm64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.11.tgz",
|
||||
"integrity": "sha512-e49E6K9hzH/ohJNx8Y26mY8HaV4I4ZViIeoqhKsmoXLKHhQnMeBAVqCgsGf2Wa3lXlS7RkporDXMHHWkzvZzFw==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.14.tgz",
|
||||
"integrity": "sha512-pHgAFffmZtaYoxavEsWEYNvcA7NwOIjLyqw2HXyLbt16xYryX0L4fMV2u0G9ag6LNYPIoqWaWqzUcnc6rLGGXg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1058,9 +1070,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-x64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.11.tgz",
|
||||
"integrity": "sha512-QSQr/KjOgXA7OzXJUWS+oguKyAZ3Q0l/lnlDGbu397eKo83atuWUjBPJrsqbKNF6CARGw8XXJLGzpHC8Ryhd4Q==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.14.tgz",
|
||||
"integrity": "sha512-oJWmBhoHsnhUKIke+0gXDX0mltJrWHA1UyHsrTlXwX0TL64ilVZAo+TYZm97baecV0esBdpzy3k96q+09JaZUQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -6654,74 +6666,74 @@
|
||||
"dev": true
|
||||
},
|
||||
"@biomejs/biome": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.11.tgz",
|
||||
"integrity": "sha512-Tj0dnkLPdW0ASjHfj2D/ZkkvPU2wrFmnE1jWTD2xzV1ycapV1DutbYXk4NDnR3rYTi1ZCbNFD4G2gRMEY65WaA==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.14.tgz",
|
||||
"integrity": "sha512-0FabLIjd4M/dm8VFI86RMaLLdgepzbdfiAL2R8cr7V81OYYrP1w7Z73KfAwPK5h9SrEBXTzNG2y+mBwPo9xRnw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@biomejs/cli-darwin-arm64": "2.5.11",
|
||||
"@biomejs/cli-darwin-x64": "2.5.11",
|
||||
"@biomejs/cli-linux-arm64": "2.5.11",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.5.11",
|
||||
"@biomejs/cli-linux-x64": "2.5.11",
|
||||
"@biomejs/cli-linux-x64-musl": "2.5.11",
|
||||
"@biomejs/cli-win32-arm64": "2.5.11",
|
||||
"@biomejs/cli-win32-x64": "2.5.11"
|
||||
"@biomejs/cli-darwin-arm64": "2.5.14",
|
||||
"@biomejs/cli-darwin-x64": "2.5.14",
|
||||
"@biomejs/cli-linux-arm64": "2.5.14",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.5.14",
|
||||
"@biomejs/cli-linux-x64": "2.5.14",
|
||||
"@biomejs/cli-linux-x64-musl": "2.5.14",
|
||||
"@biomejs/cli-win32-arm64": "2.5.14",
|
||||
"@biomejs/cli-win32-x64": "2.5.14"
|
||||
}
|
||||
},
|
||||
"@biomejs/cli-darwin-arm64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.11.tgz",
|
||||
"integrity": "sha512-6SGZxoKbXvUjMn1t6A98HqWISPnGNbYs0R/Rt2JarmXBSev+lva4QxUMWEBX9lX1Wo1XTJ78uk5xVDtG58SRZg==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.14.tgz",
|
||||
"integrity": "sha512-UnzaXO65L4tsZimFITFP2M121GyhDcWFrT3pL5ZJ5U4XcS/0L5VHYytVohdCf/gnDUFHgl2I9xnt5bV/J1kxHQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@biomejs/cli-darwin-x64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.11.tgz",
|
||||
"integrity": "sha512-nYkXY7tLBEgnGbYapDKAyKzgt44ZEyG+AKalvTXtCWKYgepI9dw327q+cVgedxm+Udi1ZzHKUyZrIusHi/KQbw==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.14.tgz",
|
||||
"integrity": "sha512-kiy8qA16K93J7uvFfWi4LgjqDpnRKyePAna6A0Y4jxyUga35SYpIZ2cNWlhy0lsfgqRenCpfymnJWEZ6mgpRgA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@biomejs/cli-linux-arm64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.11.tgz",
|
||||
"integrity": "sha512-3PVLSTD9RR73rvVPt5G3T1gc+ycggWEGfTD7RvzzbtcDPD27NxgxBbAFfpm7DXJKW6VLHWE1lLMGvFt2Qxjcow==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.14.tgz",
|
||||
"integrity": "sha512-vO/9BaU1n30CiFNLx49gMTMtbCAAqlo/EqFoG0BU3deQInTbJrmXSmTQ9e3FoDZIKQnvSLDVNL4lx1ci7y1T1Q==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@biomejs/cli-linux-arm64-musl": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.11.tgz",
|
||||
"integrity": "sha512-qhyZUMyCbWYFV2bAwRNVvfMVZ+hv7WYl6mossGrxC+uiQQXhvsuWWU8zz6jYX0mChZd9MgQZbm4vozTmG/5iGw==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.14.tgz",
|
||||
"integrity": "sha512-SJ9PrZkBnnH9dHJDnxk34vKs0GB2dbsioaft6/hPhWJ7AHpwYH83Isnhj0FSRpFkGgpVfJ1lds23ApB2czUDLQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@biomejs/cli-linux-x64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.11.tgz",
|
||||
"integrity": "sha512-JOytptlsgM33B2MMFUg8iBrb4IKpbD5JnJrSeYiaFEeAj4vuXx0iQSQZ4qK7sqyMtfjZxxPdNdMZZVL4y/mFyA==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.14.tgz",
|
||||
"integrity": "sha512-VHZRa7CCQBUWKxNwUvHJeuW03WFRgN5NWO//SDGOitc9QIeNyfA42V9zlKm+x82xFSG9Bzi5fi+hbhm9anO8yA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@biomejs/cli-linux-x64-musl": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.11.tgz",
|
||||
"integrity": "sha512-oRRlrchG5EfrEL/EmtT1qUjSNHk3/5LGeZhQqADBBAJF1b1ET6964xEKe7aGlGARzDfza8H/seEsFJl7S6Ql9w==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.14.tgz",
|
||||
"integrity": "sha512-2kI5PrMgW5dcEZYrstLPmUmCwkUwZY39rP4BN93Vxbwcs2O57LDQOktUZZYPvvspN5i0mhGr3TJtF5sU26NUWg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@biomejs/cli-win32-arm64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.11.tgz",
|
||||
"integrity": "sha512-e49E6K9hzH/ohJNx8Y26mY8HaV4I4ZViIeoqhKsmoXLKHhQnMeBAVqCgsGf2Wa3lXlS7RkporDXMHHWkzvZzFw==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.14.tgz",
|
||||
"integrity": "sha512-pHgAFffmZtaYoxavEsWEYNvcA7NwOIjLyqw2HXyLbt16xYryX0L4fMV2u0G9ag6LNYPIoqWaWqzUcnc6rLGGXg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@biomejs/cli-win32-x64": {
|
||||
"version": "2.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.11.tgz",
|
||||
"integrity": "sha512-QSQr/KjOgXA7OzXJUWS+oguKyAZ3Q0l/lnlDGbu397eKo83atuWUjBPJrsqbKNF6CARGw8XXJLGzpHC8Ryhd4Q==",
|
||||
"version": "2.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.14.tgz",
|
||||
"integrity": "sha512-oJWmBhoHsnhUKIke+0gXDX0mltJrWHA1UyHsrTlXwX0TL64ilVZAo+TYZm97baecV0esBdpzy3k96q+09JaZUQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@
|
||||
"undici": "^8.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.5.11",
|
||||
"@biomejs/biome": "^2.5.14",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^26.4.0",
|
||||
"@types/semver": "^7.8.0",
|
||||
|
||||
+2
-4
@@ -159,10 +159,8 @@ async function saveCacheToKey(
|
||||
}
|
||||
|
||||
log.info(`Including ${cacheName} path: ${cachePath}`);
|
||||
const cacheId = await cache.saveCache([cachePath], cacheKey);
|
||||
if (cacheId !== -1) {
|
||||
log.info(`${cacheName} saved with key: ${cacheKey}`);
|
||||
}
|
||||
await cache.saveCache([cachePath], cacheKey);
|
||||
log.info(`${cacheName} saved with key: ${cacheKey}`);
|
||||
}
|
||||
|
||||
run();
|
||||
|
||||
@@ -69,7 +69,5 @@ function getUvVersionFromAllDependencies(
|
||||
|
||||
function getUvVersionFromDependency(dependency: string): string | undefined {
|
||||
const dependencyWithoutMarker = dependency.split(";", 1)[0]?.trim();
|
||||
return dependencyWithoutMarker
|
||||
?.match(/^uv\s*((?:[=<>~!]+\s*[^\s,]+\s*,?\s*)+)/)?.[1]
|
||||
.replace(/\s/g, "");
|
||||
return dependencyWithoutMarker?.match(/^uv([=<>~!]+\S*)/)?.[1].trim();
|
||||
}
|
||||
|
||||
+3
-18
@@ -169,9 +169,7 @@ async function findHighestSatisfyingVersion(
|
||||
): Promise<string | undefined> {
|
||||
// This fast path assumes uv releases are semver-monotonic: newer manifest
|
||||
// entries always have higher versions, with no lower-version backports.
|
||||
const semverRange = isCompatibleReleaseSpecifier(versionSpecifier)
|
||||
? null
|
||||
: semver.validRange(versionSpecifier);
|
||||
const semverRange = semver.validRange(versionSpecifier);
|
||||
if (semverRange !== null) {
|
||||
const semverMatch = await getFirstMatchingVersion((version) =>
|
||||
semver.satisfies(version, semverRange),
|
||||
@@ -195,22 +193,11 @@ async function findHighestSatisfyingVersion(
|
||||
return pep440Match;
|
||||
}
|
||||
|
||||
/**
|
||||
* `~=` is the PEP 440 compatible release operator. semver accepts it as a
|
||||
* tilde range with a narrower upper bound (`~=0.5` as `<0.6.0` instead of
|
||||
* `<1.0`), so it must only be evaluated as PEP 440.
|
||||
*/
|
||||
function isCompatibleReleaseSpecifier(versionSpecifier: string): boolean {
|
||||
return versionSpecifier.includes("~=");
|
||||
}
|
||||
|
||||
function maxSatisfying(
|
||||
versions: string[],
|
||||
version: string,
|
||||
): string | undefined {
|
||||
const maxSemver = isCompatibleReleaseSpecifier(version)
|
||||
? ""
|
||||
: tc.evaluateVersions(versions, version);
|
||||
const maxSemver = tc.evaluateVersions(versions, version);
|
||||
if (maxSemver !== "") {
|
||||
core.debug(`Found a version that satisfies the semver range: ${maxSemver}`);
|
||||
return maxSemver;
|
||||
@@ -231,9 +218,7 @@ function minSatisfying(
|
||||
versions: string[],
|
||||
version: string,
|
||||
): string | undefined {
|
||||
const minSemver = isCompatibleReleaseSpecifier(version)
|
||||
? null
|
||||
: semver.minSatisfying(versions, version);
|
||||
const minSemver = semver.minSatisfying(versions, version);
|
||||
if (minSemver !== null) {
|
||||
core.debug(`Found a version that satisfies the semver range: ${minSemver}`);
|
||||
return minSemver;
|
||||
|
||||
Reference in New Issue
Block a user