mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-10 07:00:54 +00:00
Add plaintext.proto
Update Makefile to handle the import in `plaintext.proto`.
Import path is modified to be relative to the project root.
And we run `protoc` from where `Makefile` locates, i.e. the project
root.
Reference:
- plaintext.proto: 62b2c6c482/sec/insecure/pb/plaintext.proto
This commit is contained in:
18
Makefile
18
Makefile
@ -1,4 +1,10 @@
|
||||
FILES_TO_LINT = libp2p tests examples setup.py
|
||||
PB = libp2p/crypto/pb/crypto.proto libp2p/pubsub/pb/rpc.proto libp2p/security/insecure/pb/plaintext.proto
|
||||
PY = $(PB:.proto=_pb2.py)
|
||||
PYI = $(PB:.proto=_pb2.pyi)
|
||||
|
||||
# Set default to `protobufs`, otherwise `format` is called when typing only `make`
|
||||
all: protobufs
|
||||
|
||||
format:
|
||||
black $(FILES_TO_LINT)
|
||||
@ -10,6 +16,12 @@ lintroll:
|
||||
isort --recursive --check-only $(FILES_TO_LINT)
|
||||
flake8 $(FILES_TO_LINT)
|
||||
|
||||
protobufs:
|
||||
cd libp2p/crypto/pb && protoc --python_out=. --mypy_out=. crypto.proto
|
||||
cd libp2p/pubsub/pb && protoc --python_out=. --mypy_out=. rpc.proto
|
||||
protobufs: $(PY)
|
||||
|
||||
%_pb2.py: %.proto
|
||||
protoc --python_out=. --mypy_out=. $<
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm -f $(PY) $(PYI)
|
||||
|
||||
Reference in New Issue
Block a user