Skip to content

Commit

Permalink
chore(python): update backend sample to consume grpcio from venv (#3961)
Browse files Browse the repository at this point in the history
Backends can as well depends on grpcio and require different versions from
the ones that are installed in the system.

Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Oct 25, 2024
1 parent fd905b4 commit dd2e243
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions backend/python/common/template/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.DEFAULT_GOAL := install

.PHONY: install
install: protogen
install:
bash install.sh
$(MAKE) protogen

.PHONY: protogen
protogen: backend_pb2_grpc.py backend_pb2.py
Expand All @@ -12,7 +13,7 @@ protogen-clean:
$(RM) backend_pb2_grpc.py backend_pb2.py

backend_pb2_grpc.py backend_pb2.py:
python3 -m grpc_tools.protoc -I../.. --python_out=. --grpc_python_out=. backend.proto
bash protogen.sh

.PHONY: clean
clean: protogen-clean
Expand Down
6 changes: 6 additions & 0 deletions backend/python/common/template/protogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

source $(dirname $0)/../common/libbackend.sh

python3 -m grpc_tools.protoc -I../.. --python_out=. --grpc_python_out=. backend.proto
3 changes: 2 additions & 1 deletion backend/python/common/template/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
grpcio==1.67.0
protobuf
protobuf
grpcio-tools

0 comments on commit dd2e243

Please sign in to comment.