fix: only set UV_INDEX_STRATEGY when UV_EXTRA_INDEX_URL is also set

When UV_EXTRA_INDEX_URL is empty (on main branch), we shouldn't set
UV_INDEX_STRATEGY at all, even to an empty value. UV interprets an
empty UV_INDEX_STRATEGY env var as requiring a value, causing errors.
This commit is contained in:
Ashwin Bharambe 2025-10-31 10:08:33 -07:00
parent a51a4317b3
commit 58fe7d7b59

View file

@ -81,7 +81,7 @@ RUN set -eux; \
echo "INSTALL_MODE=editable requires LLAMA_STACK_DIR to point to a directory inside the build context" >&2; \ echo "INSTALL_MODE=editable requires LLAMA_STACK_DIR to point to a directory inside the build context" >&2; \
exit 1; \ exit 1; \
fi; \ fi; \
if [ -n "$UV_EXTRA_INDEX_URL" ]; then \ if [ -n "$UV_EXTRA_INDEX_URL" ] && [ -n "$UV_INDEX_STRATEGY" ]; then \
UV_EXTRA_INDEX_URL="$UV_EXTRA_INDEX_URL" UV_INDEX_STRATEGY="$UV_INDEX_STRATEGY" \ UV_EXTRA_INDEX_URL="$UV_EXTRA_INDEX_URL" UV_INDEX_STRATEGY="$UV_INDEX_STRATEGY" \
uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \ uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \
else \ else \