ci: switch to uv in setup.sh

This commit is contained in:
daywalker90 2025-08-18 12:09:45 +02:00
parent 0a9eb7cd82
commit 675e625dcd
No known key found for this signature in database
2 changed files with 2 additions and 25 deletions

View file

@ -112,14 +112,13 @@ jobs:
- name: Get plugin binary
run: |
source venv/bin/activate
if ${{ inputs.tagged-release }}; then
cd tests
./setup.sh
cd ..
else
if [ -d "proto" ]; then
python -m grpc_tools.protoc --proto_path="proto" --python_out="tests" --grpc_python_out="tests" proto/*.proto
uv run python -m grpc_tools.protoc --proto_path="proto" --python_out="tests" --grpc_python_out="tests" proto/*.proto
fi
cargo build

View file

@ -68,32 +68,10 @@ else
# exit 1
fi
# Function to check if a Python package is installed
check_package() {
python_exec="$1"
package_name="$2"
if $python_exec -c "import $package_name" &> /dev/null; then
return 0
else
return 1
fi
}
proto_path="$script_dir/../proto"
if [ -d "$proto_path" ]; then
# Check if the package is installed in the first Python executable
if check_package "$TEST_DIR/bin/python3" "grpc"; then
python_exec="$TEST_DIR/bin/python3"
elif check_package "python3" "grpc"; then
python_exec="python3"
else
echo "Error: Package 'grpcio' is not installed" >&2
exit 1
fi
# Generate grpc files
if ! "$python_exec" -m grpc_tools.protoc --proto_path="$proto_path" --python_out=$script_dir --grpc_python_out=$script_dir $proto_path/*.proto; then
if ! uv run python -m grpc_tools.protoc --proto_path="$proto_path" --python_out=$script_dir --grpc_python_out=$script_dir $proto_path/*.proto; then
echo "Error generating grpc files" >&2
exit 1
fi