Skip to content

Commit

Permalink
feat: update proto build path
Browse files Browse the repository at this point in the history
  • Loading branch information
keivanipchihagh committed Apr 21, 2024
1 parent 76c8ea2 commit 67afd77
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion protos/athena/athena.proto → protos/athena.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package athena.v1;

import "athena/athena_struct.proto";
import "athena_struct.proto";
import "candlestick_struct.proto";

// [message] GetBacktestRequest
Expand Down
File renamed without changes.
9 changes: 5 additions & 4 deletions scripts/build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

working_dir=$(pwd)
proto_dirs=($(pwd)/protos) # ./protos/
python_out=($(pwd)/protos/src/python) # ./protos/src/python/

# Build *.proto files within the ./protobufs/ directory
for file in $(find "$proto_dirs" -type f); do
for file in $(find "$proto_dirs" -type f -name "*.proto"); do
filename=$(basename "$file")
if echo "$filename" | grep -q "struct"; then
# Only RPC for structs
python3 -m grpc_tools.protoc\
--proto_path=$proto_dirs\
--python_out=$proto_dirs\
--python_out=$python_out\
$file
else
# RPC and gRPC for non structs
python3 -m grpc_tools.protoc\
--proto_path=$proto_dirs\
--python_out=$proto_dirs\
--grpc_python_out=$proto_dirs\
--python_out=$python_out\
--grpc_python_out=$python_out\
$file
fi
done
Empty file modified scripts/clean.sh
100755 → 100644
Empty file.

0 comments on commit 67afd77

Please sign in to comment.