mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-02-08 02:27:26 +00:00
fix: prevent matching package names starting with 'uv' in dependency parsing
The previous regex would match any package starting with 'uv' (like 'uvicorn', 'uvloop', etc.) and incorrectly parse them as uv version specifications. This fix ensures we only match the actual 'uv' package by requiring a version specifier character immediately after 'uv'. Fixes the issue where 'uvicorn==0.35.0' was being parsed as 'icorn==0.35.0'.
This commit is contained in:
parent
05273c154d
commit
5a9b0f020b
1 changed files with 2 additions and 2 deletions
|
|
@ -15,8 +15,8 @@ function getUvVersionFromAllDependencies(
|
|||
allDependencies: string[],
|
||||
): string | undefined {
|
||||
return allDependencies
|
||||
.find((dep: string) => dep.startsWith("uv"))
|
||||
?.match(/^uv([^A-Z0-9._-]+.*)$/)?.[1]
|
||||
.find((dep: string) => dep.match(/^uv[=<>~!]/))
|
||||
?.match(/^uv([=<>~!]+.*)$/)?.[1]
|
||||
.trim();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue