diff --git a/ensure_pure_cbor2.sh b/ensure_pure_cbor2.sh index 7ba82779..9c50a210 100755 --- a/ensure_pure_cbor2.sh +++ b/ensure_pure_cbor2.sh @@ -1,7 +1,7 @@ #!/bin/bash # Script to ensure cbor2 is installed with pure Python implementation -set -e +set -x # Check if poetry is available, otherwise use python directly if command -v poetry &> /dev/null; then @@ -27,12 +27,12 @@ sys.exit(1 if using_c_ext else 0) if [ $? -ne 0 ]; then echo "Reinstalling cbor2 with pure Python implementation..." - $PYTHON -m pip uninstall -y cbor2 - CBOR2_BUILD_C_EXTENSION=0 $PYTHON -m pip install --no-binary cbor2 "cbor2==$CBOR2_VERSION" --force-reinstall + $PYTHON -m pip uninstall -y cbor2 || uv pip uninstall cbor2 + CBOR2_BUILD_C_EXTENSION=0 $PYTHON -m pip install --no-binary cbor2 "cbor2==$CBOR2_VERSION" --force-reinstall || CBOR2_BUILD_C_EXTENSION=0 uv pip install --no-binary cbor2 "cbor2==$CBOR2_VERSION" --force-reinstall echo "Successfully reinstalled cbor2 with pure Python implementation" else echo "Already using pure Python implementation of cbor2" fi # Clean up -rm -f .cbor2_version \ No newline at end of file +rm -f .cbor2_version