refactor: test_wheel.sh to dynamically find wheel files
- Updated script to search for wheel files using a pattern. - Added error handling for cases with no matches or multiple matches. - Improved output to indicate the found wheel file.
This commit is contained in:
@@ -1,13 +1,30 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
WHEEL_PATH="python-dist/reticulum_meshchatx-2.41.0-py3-none-any.whl"
|
# Find wheel file dynamically
|
||||||
|
WHEEL_PATTERN="python-dist/reticulum_meshchatx-*-py3-none-any.whl"
|
||||||
|
WHEEL_FILES=($WHEEL_PATTERN)
|
||||||
|
|
||||||
|
if [ ${#WHEEL_FILES[@]} -eq 0 ]; then
|
||||||
|
echo "Error: No wheel files found matching pattern: $WHEEL_PATTERN"
|
||||||
|
echo "Make sure to run 'poetry build' or similar to create the wheel first."
|
||||||
|
exit 1
|
||||||
|
elif [ ${#WHEEL_FILES[@]} -gt 1 ]; then
|
||||||
|
echo "Error: Multiple wheel files found:"
|
||||||
|
printf ' %s\n' "${WHEEL_FILES[@]}"
|
||||||
|
echo "Please clean up old wheels or specify which one to use."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
WHEEL_PATH="${WHEEL_FILES[0]}"
|
||||||
|
|
||||||
if [ ! -f "$WHEEL_PATH" ]; then
|
if [ ! -f "$WHEEL_PATH" ]; then
|
||||||
echo "Error: Wheel not found at $WHEEL_PATH"
|
echo "Error: Wheel not found at $WHEEL_PATH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Found wheel: $WHEEL_PATH"
|
||||||
|
|
||||||
echo "Creating test virtual environment..."
|
echo "Creating test virtual environment..."
|
||||||
TEST_VENV=$(mktemp -d)/test-venv
|
TEST_VENV=$(mktemp -d)/test-venv
|
||||||
python3 -m venv "$TEST_VENV"
|
python3 -m venv "$TEST_VENV"
|
||||||
|
|||||||
Reference in New Issue
Block a user