Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ensure_pure_cbor2.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
rm -f .cbor2_version