From 979d385eeaf3f89cca37a9f54f74492f3c2c670c Mon Sep 17 00:00:00 2001 From: Joe Li Date: Thu, 20 Nov 2025 10:42:42 -0800 Subject: [PATCH] fix: recompile dependencies with linux and update generate dependency script (#36194) --- scripts/uv-pip-compile.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/uv-pip-compile.sh b/scripts/uv-pip-compile.sh index db46393f13b..88ff35e2f4d 100755 --- a/scripts/uv-pip-compile.sh +++ b/scripts/uv-pip-compile.sh @@ -19,6 +19,23 @@ set -e +# If not already running in Docker, run this script inside Docker +if [ -z "$RUNNING_IN_DOCKER" ]; then + # Extract "current" Python version from CI config (single source of truth) + PYTHON_VERSION=$(grep -A 1 'if.*"current"' .github/actions/setup-backend/action.yml | grep 'PYTHON_VERSION=' | sed 's/.*PYTHON_VERSION=\([0-9.]*\).*/\1/') + + echo "Running in Docker (Python ${PYTHON_VERSION} on Linux)..." + + docker run --rm \ + -v "$(pwd)":/app \ + -w /app \ + -e RUNNING_IN_DOCKER=1 \ + python:${PYTHON_VERSION}-slim \ + bash -c "pip install uv && ./scripts/uv-pip-compile.sh $*" + + exit $? +fi + ADDITIONAL_ARGS="$@" # Generate the requirements/base.txt file