5
0
mirror of https://github.com/astral-sh/setup-uv.git synced 2025-12-17 11:05:59 +00:00

Use latest version from manifest-file (#458)

If a manifest-file is supplied the default value of the version input
(latest) will get the latest version available in the manifest. That
might not be the actual latest version available in the official uv
repo.
This commit is contained in:
Kevin Stillhammer
2025-06-19 21:23:43 +02:00
committed by GitHub
parent a02a550bdd
commit 445689ea25
5 changed files with 46 additions and 17 deletions

View File

@@ -87,7 +87,7 @@ async function setupUv(
checkSum: string | undefined,
githubToken: string,
): Promise<{ uvDir: string; version: string }> {
const resolvedVersion = await determineVersion();
const resolvedVersion = await determineVersion(manifestFile);
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
if (toolCacheResult.installedPath) {
core.info(`Found uv in tool-cache for ${toolCacheResult.version}`);
@@ -127,9 +127,11 @@ async function setupUv(
};
}
async function determineVersion(): Promise<string> {
async function determineVersion(
manifestFile: string | undefined,
): Promise<string> {
if (versionInput !== "") {
return await resolveVersion(versionInput, githubToken);
return await resolveVersion(versionInput, manifestFile, githubToken);
}
const versionFromUvToml = getUvVersionFromConfigFile(
`${workingDirectory}${path.sep}uv.toml`,
@@ -144,6 +146,7 @@ async function determineVersion(): Promise<string> {
}
return await resolveVersion(
versionFromUvToml || versionFromPyproject || "latest",
manifestFile,
githubToken,
);
}