mirror of
https://github.com/daywalker90/cln-nip47.git
synced 2026-08-13 12:33:43 +02:00
ci: switch to uv in setup.sh
This commit is contained in:
parent
0a9eb7cd82
commit
675e625dcd
2 changed files with 2 additions and 25 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue