File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 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
77if command -v poetry & > /dev/null; then
@@ -16,7 +16,6 @@ CBOR2_VERSION=$(cat .cbor2_version)
1616echo " Found cbor2 version: $CBOR2_VERSION "
1717
1818echo " Checking cbor2 implementation..."
19- set +e
2019$PYTHON -c "
2120import cbor2, inspect, sys
2221decoder_path = inspect.getfile(cbor2.CBORDecoder)
@@ -25,12 +24,11 @@ print(f'Implementation path: {decoder_path}')
2524print(f'Using C extension: {using_c_ext}')
2625sys.exit(1 if using_c_ext else 0)
2726"
28- set -e
2927
3028if [ $? -ne 0 ]; then
3129 echo " Reinstalling cbor2 with pure Python implementation..."
32- $PYTHON -m pip uninstall -y cbor2
33- 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 -y 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
3432 echo " Successfully reinstalled cbor2 with pure Python implementation"
3533else
3634 echo " Already using pure Python implementation of cbor2"
You can’t perform that action at this time.
0 commit comments