Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,26 @@ jobs:
- name: Generate dotnet v1beta
run: buf generate --template buf.gen.dotnet.v1beta.yaml

# The protobuf Python plugin emits absolute imports rooted at the proto
# package (e.g. `from utxorpc.v1alpha...`), which do not resolve once the
# code is packaged under `utxorpc_spec`. protoletariat rewrites the
# proto-generated imports to relative imports so the single utxorpc-spec
# package works regardless of where it is mounted.
- name: Fix python imports
run:
find gen/python/utxorpc_spec -type f -exec sed -i '' 's@from
utxorpc@from utxorpc_spec.utxorpc@g' {} \;
run: |
pipx install protoletariat
protol \
--create-package \
--in-place \
--exclude-google-imports \
--python-out gen/python/utxorpc_spec \
buf proto

- name: Smoke-test python imports
run: |
pip install --quiet protobuf grpcio
cd gen/python
python -c "import utxorpc_spec.utxorpc.v1alpha.sync.sync_pb2, utxorpc_spec.utxorpc.v1beta.sync.sync_pb2; print('python import OK')"

- name: Create codegen artifact
uses: actions/upload-artifact@v4
Expand Down
Loading