-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] Clean up protobuf generation for golang (#1357)
## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Cleans up protobuf generation for golang - New functionality - ... ## Test plan *How are these changes tested?* - [ ] Manually run make proto_go ## Documentation Changes *Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?*
- Loading branch information
Showing
2 changed files
with
16 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
.PHONY: proto | ||
|
||
proto: | ||
@echo "Generating gRPC code..." | ||
proto_python: | ||
@echo "Generating gRPC code for python..." | ||
@python -m grpc_tools.protoc -I ./ --python_out=. --pyi_out=. --grpc_python_out=. ./chromadb/proto/*.proto | ||
@mv chromadb/proto/*.py ../chromadb/proto/ | ||
@mv chromadb/proto/*.pyi ../chromadb/proto/ | ||
@echo "Done" | ||
|
||
proto_go: | ||
@echo "Generating gRPC code for golang..." | ||
@protoc \ | ||
--go_out=../go/coordinator/internal/proto/coordinatorpb \ | ||
--go_opt paths=source_relative \ | ||
--plugin protoc-gen-go="${GOPATH}/bin/protoc-gen-go" \ | ||
--go-grpc_out=../go/coordinator/internal/proto/coordinatorpb \ | ||
--go-grpc_opt paths=source_relative \ | ||
--plugin protoc-gen-go-grpc="${GOPATH}/bin/protoc-gen-go-grpc" \ | ||
chromadb/proto/*.proto | ||
@mv ../go/coordinator/internal/proto/coordinatorpb/chromadb/proto/*.go ../go/coordinator/internal/proto/coordinatorpb/ | ||
@rm -rf ../go/coordinator/internal/proto/coordinatorpb/chromadb | ||
@echo "Done" |