Skip to content

Conversation

@richardlarocque
Copy link
Contributor

@richardlarocque richardlarocque commented Nov 19, 2025

VI-13156

Adds support for building Python protobuf client stubs. Adds pinned
versions for the relevant tools in versions.yaml.

This Python build script eschews fancier systems like poetry or uv
in favor of managing its own virtualenv. It maintains a virtualenv
under a .venv-codegen directory under the repo's root and installs the
necessary tools (grpcio, betterproto) there.

Also adds some placeholders for Python package building and publishing.

@richardlarocque richardlarocque force-pushed the richardlarocque/vi_13156_python_grpc_clients branch 2 times, most recently from c5416dd to 6bd63b1 Compare November 21, 2025 19:14
[VI-13156](https://outreach-io.atlassian.net/browse/VI-13156)

Adds support for building Python protobuf client stubs.  Adds pinned
versions for the relevant tools in `versions.yaml`.

This Python build script eschews fancier systems like `poetry` or `uv`
in favor of managing its own virtualenv.  It maintains a virtualenv
under a `.venv-codegen` directory under the repo's root and installs the
necessary tools (grpcio, betterproto) there.

Also adds some placeholders for Python package building and publishing.
@richardlarocque richardlarocque force-pushed the richardlarocque/vi_13156_python_grpc_clients branch from 6bd63b1 to dee5cfc Compare November 26, 2025 17:01
@getoutreach-ci-2
Copy link

Link to code coverage report (posted by coverbot 🤖)

@richardlarocque
Copy link
Contributor Author

richardlarocque commented Nov 26, 2025

The RFC has more context and discussion around this PR.


I'll acknowledge up front that this unlikely to be the long-term solution for protobuf generation. In the RFC discussion, we talked about moving some of this tooling more towards the repo and away from protoc.sh. There would be some merit in that approach.

The current approach is driven by the concern that this has to work. This protoc.sh script runs on make gogenerate, which runs with stencil, and it's really bad to break re-stencil-ing workflows. Therefore this approach aims to be as boring as possible and limit dependencies on external tools and developer laptop configuration.

The version presented in this PR should work so long as you have a Python on your path that is less than 10 years old + a network connection to PyPI. We dodge dependencies on poetry, AWS CodeArtifact, and other such things that would come with a more "repo-local" approach.


Also, one more thing:

This code is flagged so it runs only in repos that declare a desire to generate Python gRPC stubs.

As I write this, the code to support such declarations is in PR. No such repos exist. We'll be opting them in one at a time over the next few weeks, based on the needs of the AI platform.

We'll get to try this out one repo at a time. It should be safe in that respect. Even if this code is somehow broken, we won't be breaking everyone all at once.

@richardlarocque richardlarocque marked this pull request as ready for review November 26, 2025 17:47
@richardlarocque richardlarocque requested a review from a team as a code owner November 26, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant