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
36
__tests__/helpers/setup-inputs.ts
Normal file
36
__tests__/helpers/setup-inputs.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { CacheLocalSource, type SetupInputs } from "../../src/utils/inputs";
|
||||
|
||||
export function createSetupInputs(
|
||||
overrides: Partial<SetupInputs> = {},
|
||||
): SetupInputs {
|
||||
return {
|
||||
activateEnvironment: false,
|
||||
addProblemMatchers: false,
|
||||
cacheDependencyGlob: "uv.lock",
|
||||
cacheLocalPath: {
|
||||
path: "/tmp/setup-uv-cache",
|
||||
source: CacheLocalSource.Input,
|
||||
},
|
||||
cachePython: false,
|
||||
cacheSuffix: "",
|
||||
checksum: "",
|
||||
downloadFromAstralMirror: false,
|
||||
enableCache: true,
|
||||
githubToken: "",
|
||||
ignoreEmptyWorkdir: false,
|
||||
ignoreNothingToCache: false,
|
||||
noProject: false,
|
||||
pruneCache: true,
|
||||
pythonDir: "/tmp/uv-python-dir",
|
||||
pythonVersion: "",
|
||||
quiet: false,
|
||||
resolutionStrategy: "highest",
|
||||
restoreCache: false,
|
||||
saveCache: true,
|
||||
venvPath: "/workspace/.venv",
|
||||
version: "",
|
||||
versionFile: "",
|
||||
workingDirectory: "/workspace",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user