mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-07-07 12:11:34 +00:00
Fix cache keys for Python version ranges (#937)
## Summary - URL-encode the Python version component before adding it to the cache key - URL-encode the user-provided cache suffix for the same reason - Add cache key tests for Python ranges, comma-containing suffixes, and unchanged simple inputs Fixes #914 Refs: pi-session 019f3164-85e7-7817-bffd-501d89b3a1fd ## Tests - npm run all
This commit is contained in:
committed by
GitHub
parent
3cc3c11fdf
commit
17c398959b
6
src/cache/restore-cache.ts
vendored
6
src/cache/restore-cache.ts
vendored
@@ -94,8 +94,10 @@ async function computeKeys(
|
||||
if (cacheDependencyPathHash === "-") {
|
||||
cacheDependencyPathHash = "-no-dependency-glob";
|
||||
}
|
||||
const suffix = inputs.cacheSuffix ? `-${inputs.cacheSuffix}` : "";
|
||||
const version = pythonVersion ?? "unknown";
|
||||
const suffix = inputs.cacheSuffix
|
||||
? `-${encodeURIComponent(inputs.cacheSuffix)}`
|
||||
: "";
|
||||
const version = encodeURIComponent(pythonVersion ?? "unknown");
|
||||
const platform = await getPlatform();
|
||||
const osNameVersion = getOSNameVersion();
|
||||
const pruned = inputs.pruneCache ? "-pruned" : "";
|
||||
|
||||
Reference in New Issue
Block a user