mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-23 00:41:40 +00:00
fix(cron_vm): handle bare uv version pin in pyproject.toml
Bugbot flagged that the awk extracting PINNED_UV_VERSION required the value to start with a specifier (`==`, `>=`, etc.) and silently fell through to the system uv if pyproject.toml later switched to a bare `required-version = "0.10.9"` form. Strip any leading specifier prefix from the quoted value rather than requiring one to be present, so both prefixed and bare forms resolve to the same download URL. Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
This commit is contained in:
parent
6c69b1d502
commit
4494c43fe7
1 changed files with 11 additions and 2 deletions
|
|
@ -191,8 +191,17 @@ fi
|
|||
# checked-out tag asks for, cached under .uv-bin/ inside the worktree
|
||||
# so subsequent runs skip the download.
|
||||
PINNED_UV_VERSION="$(
|
||||
awk -F'"' '/^required-version[[:space:]]*=/{ for (i=2; i<=NF; i++) if ($i ~ /^[=<>!~]+/) { gsub(/^[=<>!~]+/, "", $i); print $i; exit } }' \
|
||||
"${WORKTREE}/pyproject.toml"
|
||||
awk -F'"' '
|
||||
/^required-version[[:space:]]*=/ {
|
||||
# Field 2 is the value between the quotes, e.g. ">=0.10.9" or
|
||||
# "0.10.9". Strip any leading specifier prefix so we end up with
|
||||
# the bare version string, which is what /releases/download/<v>/
|
||||
# expects.
|
||||
v = $2
|
||||
sub(/^[[:space:]=<>!~]+/, "", v)
|
||||
if (v != "") { print v; exit }
|
||||
}
|
||||
' "${WORKTREE}/pyproject.toml"
|
||||
)"
|
||||
if [[ -z "${PINNED_UV_VERSION}" ]]; then
|
||||
log "no uv version pin in pyproject.toml; using system uv"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue