Skip to content

Commit 0f412ac

Browse files
authored
Don't exit script when c extension detected (#467)
* Don't exit script when c extension detected * Add uv support * Update ensure_pure_cbor2.sh
1 parent 95e5b02 commit 0f412ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ensure_pure_cbor2.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# Script to ensure cbor2 is installed with pure Python implementation
33

4-
set -e
4+
set -x
55

66
# Check if poetry is available, otherwise use python directly
77
if command -v poetry &> /dev/null; then
@@ -27,12 +27,12 @@ sys.exit(1 if using_c_ext else 0)
2727

2828
if [ $? -ne 0 ]; then
2929
echo "Reinstalling cbor2 with pure Python implementation..."
30-
$PYTHON -m pip uninstall -y cbor2
31-
CBOR2_BUILD_C_EXTENSION=0 $PYTHON -m pip install --no-binary cbor2 "cbor2==$CBOR2_VERSION" --force-reinstall
30+
$PYTHON -m pip uninstall -y cbor2 || uv pip uninstall cbor2
31+
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
3232
echo "Successfully reinstalled cbor2 with pure Python implementation"
3333
else
3434
echo "Already using pure Python implementation of cbor2"
3535
fi
3636

3737
# Clean up
38-
rm -f .cbor2_version
38+
rm -f .cbor2_version

0 commit comments

Comments
 (0)