diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml index 86049b7..38ff1d3 100644 --- a/.github/workflows/update_protobufs.yml +++ b/.github/workflows/update_protobufs.yml @@ -22,6 +22,11 @@ jobs: tar xvzf nanopb-0.4.6-linux-x86.tar.gz mv nanopb-0.4.6-linux-x86 nanopb-0.4.6 + - name: Install poetry (needed by regen-protobufs.sh) + run: | + python -m pip install --upgrade pip + pip3 install poetry + - name: Re-generate protocol buffers run: | ./bin/regen-protobufs.sh diff --git a/bin/regen-protobufs.sh b/bin/regen-protobufs.sh index 1f2f23c..ac56608 100755 --- a/bin/regen-protobufs.sh +++ b/bin/regen-protobufs.sh @@ -4,8 +4,11 @@ #gsed -i 's/import "\//import ".\//g' ./protobufs/meshtastic/* #gsed -i 's/package meshtastic;//g' ./protobufs/meshtastic/* -./nanopb-0.4.7/generator-bin/protoc -I=protobufs --python_out ./ --mypy_out ./ ./protobufs/meshtastic/*.proto -./nanopb-0.4.7/generator-bin/protoc -I=protobufs --python_out ./meshtastic/ --mypy_out ./meshtastic/ ./protobufs/nanopb.proto +# protoc looks for mypy plugin in the python path +source $(poetry env info --path)/bin/activate + +./nanopb-0.4.6/generator-bin/protoc -I=protobufs --python_out ./ --mypy_out ./ ./protobufs/meshtastic/*.proto +./nanopb-0.4.6/generator-bin/protoc -I=protobufs --python_out ./meshtastic/ --mypy_out ./meshtastic/ ./protobufs/nanopb.proto # workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628