Add Python protobuf bindings pipeline and PyPI release workflow - #291
Conversation
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
|
Hi @kmilodenisglez, thanks for the PR! It's great to hear you're working on the Python Fabric Gateway client, and adding the Python fabric proto bindings here is nice. I noticed you added a python specific build script instead of using buf in the same way as the other languages. Was that due to grpc/grpc#26125 or was it for a different reason? Thanks again, James |
Hi @jt-nti, thanks for checking this. Short answer: partly related, but the main reason was packaging and import stability for a publishable Python artifact. Using buf alone is fine for proto generation, but for Python we still needed a deterministic post-generation step to make the generated modules work correctly inside the fabric_protos package namespace (including package markers and import rewriting). The import behavior in grpc/protobuf Python generation is in the same area as grpc/grpc#26125, so that issue was a factor in the decision, but not the only reason. I used the dedicated script so the Python wheel/sdist are reproducible and import-safe for downstream use in the Python Fabric Gateway client PR. If maintainers prefer, I can also switch this to a buf-driven entry point plus the same post-processing step. |
|
Hi @kmilodenisglez, thanks for the reply. It sounds like the post-processing step could work with buf generation in the future. If the maintainers are happy with everything else (I'm not a Python expert!), I don't think switching to buf now should be a blocker given the issue with the protoc plugin. It would be good to update the README.md and RELEASING.md files to mention the new binding though, with a comment about not using buf, before merging. |
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
Hi @jt-nti, thanks for the feedback. I have updated both README.md and RELEASING.md to include the new Python binding, the Python package release artifact, and a note that Python generation currently uses grpc_tools.protoc plus post-processing (not direct buf generate yet). I also added the Python pyproject version file to the release versioning checklist. |
|
Thanks @kmilodenisglez, that looks great. @pfi79, could you have a look when you get a chance please? |
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
|
@kmilodenisglez where can I see the result? |
|
@pfi79 Just a quick heads-up regarding the CI run: The build completed successfully, but the Publish to PyPI step was skipped. (PyPI is the official public registry for Python packages—similar to npm for Node.js or Maven for Java—where users download libraries via I think this might have been skipped because this run was triggered from a PR/branch without a release tag—could that be the reason? If so, will it automatically publish to PyPI once this gets merged into |
Look, every successful pr poured into main is published. So made for go and for node. |
Yes @pfi79 . I checked the Python workflow together with The existing Python workflow already has the development-version handling needed for PyPI. For non-release builds it converts, for example, Now non-release Python distributions are currently uploaded as GitHub Actions artifacts instead of being published to PyPI. So I can align it with the Node.js behavior by publishing on every non-PR push, while keeping the existing release detection:
No changes to I'll push this update to the PR shortly! |
Summary
This pull request adds first-class Python bindings generation, packaging, and release automation to fabric-protos.
Motivation
I am currently implementing the Python Fabric Gateway client and preparing its contribution for review. To validate and submit that gateway PR properly, we need official Python protobuf and gRPC bindings published from fabric-protos, with a repeatable generation process and a release path to PyPI.
What is included
Validation performed
All checks above pass.
Impact
Follow-up
After this lands, the Fabric Gateway Python PR can consume and validate against these published Python protobuf bindings.