feat(server): Add mypy-protobuf (#141)
Generates .pyi files for protobuf stubs which provide strong typing information. Very helpful for IDE auto-completion, etc.
This commit is contained in:
parent
462530c2b0
commit
8e8dd984d8
|
@ -3,9 +3,10 @@ flash_att_commit := 4d87e4d875077ad9efd25030efa4ab0ba92c19e1
|
|||
|
||||
gen-server:
|
||||
# Compile protos
|
||||
pip install grpcio-tools==1.51.1 --no-cache-dir
|
||||
pip install grpcio-tools==1.51.1 mypy-protobuf==3.4.0 'types-protobuf>=3.20.4' --no-cache-dir
|
||||
mkdir text_generation_server/pb || true
|
||||
python -m grpc_tools.protoc -I../proto --python_out=text_generation_server/pb --grpc_python_out=text_generation_server/pb ../proto/generate.proto
|
||||
python -m grpc_tools.protoc -I../proto --python_out=text_generation_server/pb \
|
||||
--grpc_python_out=text_generation_server/pb --mypy_out=text_generation_server/pb ../proto/generate.proto
|
||||
find text_generation_server/pb/ -type f -name "*.py" -print0 -exec sed -i -e 's/^\(import.*pb2\)/from . \1/g' {} \;
|
||||
touch text_generation_server/pb/__init__.py
|
||||
|
||||
|
|
Loading…
Reference in New Issue