From d2a462fc930d6a63e3369186d2d8cabbdc5e7102 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 12 Apr 2025 11:03:21 -0700 Subject: [PATCH] ci: handle whl --- .circleci/config.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a53ce55fd..feb425a38e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2426,24 +2426,36 @@ jobs: # If versions are equal or current is greater, check contents pip download --no-deps litellm-proxy-extras==$LAST_VERSION -d /tmp - # Find the downloaded file + echo "Contents of /tmp directory:" - ls -R /tmp - DOWNLOADED_FILE=$(ls /tmp/litellm_proxy_extras-*.tar.gz) - tar -xzf "$DOWNLOADED_FILE" -C /tmp - + ls -la /tmp + + # Find the downloaded file (could be .whl or .tar.gz) + DOWNLOADED_FILE=$(ls /tmp/litellm_proxy_extras-*) echo "Downloaded file: $DOWNLOADED_FILE" - echo "Contents of extracted package:" - ls -R /tmp/litellm_proxy_extras-$LAST_VERSION + + # Extract based on file extension + if [[ "$DOWNLOADED_FILE" == *.whl ]]; then + echo "Extracting wheel file..." + unzip -q "$DOWNLOADED_FILE" -d /tmp/extracted + EXTRACTED_DIR="/tmp/extracted" + else + echo "Extracting tar.gz file..." + tar -xzf "$DOWNLOADED_FILE" -C /tmp + EXTRACTED_DIR="/tmp/litellm_proxy_extras-$LAST_VERSION" + fi + + echo "Contents of extracted package:" + ls -R "$EXTRACTED_DIR" # Compare contents - if ! diff -r /tmp/litellm_proxy_extras-$LAST_VERSION/litellm_proxy_extras ./litellm_proxy_extras; then + if ! diff -r "$EXTRACTED_DIR/litellm_proxy_extras" ./litellm_proxy_extras; then if [ "$CURRENT_VERSION" = "$LAST_VERSION" ]; then echo "Error: Changes detected in litellm-proxy-extras but version was not bumped" echo "Current version: $CURRENT_VERSION" echo "Last published version: $LAST_VERSION" echo "Changes:" - diff -r /tmp/litellm_proxy_extras-$LAST_VERSION/litellm_proxy_extras ./litellm_proxy_extras + diff -r "$EXTRACTED_DIR/litellm_proxy_extras" ./litellm_proxy_extras exit 1 fi else