Skip to content

Commit 66303d4

Browse files
authored
Add uv support
1 parent 6ea3599 commit 66303d4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ensure_pure_cbor2.sh

Lines changed: 3 additions & 5 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
@@ -16,7 +16,6 @@ CBOR2_VERSION=$(cat .cbor2_version)
1616
echo "Found cbor2 version: $CBOR2_VERSION"
1717

1818
echo "Checking cbor2 implementation..."
19-
set +e
2019
$PYTHON -c "
2120
import cbor2, inspect, sys
2221
decoder_path = inspect.getfile(cbor2.CBORDecoder)
@@ -25,12 +24,11 @@ print(f'Implementation path: {decoder_path}')
2524
print(f'Using C extension: {using_c_ext}')
2625
sys.exit(1 if using_c_ext else 0)
2726
"
28-
set -e
2927

3028
if [ $? -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"
3533
else
3634
echo "Already using pure Python implementation of cbor2"

0 commit comments

Comments
 (0)