From b95242a80ffc02cf67ab4e5c21041b4b9e9f30fe Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Fri, 13 Mar 2026 20:26:10 +0000 Subject: [PATCH] fix: only skip frontend build for PyPI prebuilt (site-packages + dist check) --- studio/setup.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/studio/setup.sh b/studio/setup.sh index dacf64564a..f1475b7c8a 100755 --- a/studio/setup.sh +++ b/studio/setup.sh @@ -41,10 +41,13 @@ if [[ "$keynames" == *$'\nCOLAB_'* ]]; then fi # ── Detect whether frontend needs building ── -# Just check if dist/ already exists — no need to guess install mode. -# Source is always present (include-package-data = true), only dist/ may be missing. -if [ -d "$SCRIPT_DIR/frontend/dist" ]; then - echo "✅ Frontend already built — skipping Node/npm check." +# Only skip when BOTH conditions are true: +# 1. We're inside site-packages (PyPI / pip install, not editable) +# 2. dist/ already exists (pre-built in the wheel) +# Otherwise always (re)build — handles upgrades, editable installs, and +# pip-from-source where dist/ was never built. +if [[ "$SCRIPT_DIR" == */site-packages/* ]] && [ -d "$SCRIPT_DIR/frontend/dist" ]; then + echo "✅ Frontend pre-built (PyPI) — skipping Node/npm check." else NEED_NODE=true if command -v node &>/dev/null && command -v npm &>/dev/null; then