Skip to content

Commit 7bea6f6

Browse files
committed
For poetry change: need to put venv in our path so mypy protobuf plugin works
1 parent 725de4c commit 7bea6f6

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/update_protobufs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
tar xvzf nanopb-0.4.6-linux-x86.tar.gz
2323
mv nanopb-0.4.6-linux-x86 nanopb-0.4.6
2424
25+
- name: Install poetry (needed by regen-protobufs.sh)
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip3 install poetry
29+
2530
- name: Re-generate protocol buffers
2631
run: |
2732
./bin/regen-protobufs.sh

bin/regen-protobufs.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
#gsed -i 's/import "\//import ".\//g' ./protobufs/meshtastic/*
55
#gsed -i 's/package meshtastic;//g' ./protobufs/meshtastic/*
66

7-
./nanopb-0.4.7/generator-bin/protoc -I=protobufs --python_out ./ --mypy_out ./ ./protobufs/meshtastic/*.proto
8-
./nanopb-0.4.7/generator-bin/protoc -I=protobufs --python_out ./meshtastic/ --mypy_out ./meshtastic/ ./protobufs/nanopb.proto
7+
# protoc looks for mypy plugin in the python path
8+
source $(poetry env info --path)/bin/activate
9+
10+
./nanopb-0.4.6/generator-bin/protoc -I=protobufs --python_out ./ --mypy_out ./ ./protobufs/meshtastic/*.proto
11+
./nanopb-0.4.6/generator-bin/protoc -I=protobufs --python_out ./meshtastic/ --mypy_out ./meshtastic/ ./protobufs/nanopb.proto
912

1013
# workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628
1114

0 commit comments

Comments
 (0)