Uh oh!
There was an error while loading. Please reload this page.
fix(python): commit proto stubs so sdist-based builds produce working wheels - #2598
Open
andre-motta wants to merge 2 commits into
Open
fix(python): commit proto stubs so sdist-based builds produce working wheels#2598andre-motta wants to merge 2 commits into
andre-motta wants to merge 2 commits into
Conversation
… wheels Proto stubs under python/openshell/_proto/ were gitignored and only generated through the mise task graph. Any PEP 517 build from sdist (pip, build, fromager) produced a wheel with an empty _proto/ directory, causing import failures. Commit the generated stubs, remove the maturin include workaround, and add a CI freshness check that regenerates and diffs to catch stale stubs. ClosesNVIDIA#2596 Signed-off-by: Andre Lustosa <alustosa@redhat.com>
andre-motta
requested review from
a team, derekwaynecarr, maxamillion and mrunalp
as code ownersAugust 3, 2026 14:31
All contributors have signed the DCO ✍️ ✅ |
andre-motta
commented
Aug 3, 2026
Author
I have read the DCO document and I hereby sign the DCO. |
andre-motta
commented
Aug 3, 2026
Author
recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Commit the generated protobuf/gRPC stubs under
python/openshell/_proto/sothat PEP 517 builds from the source tarball produce importable wheels. Previously
the stubs were gitignored and only generated through the mise task graph, so any
standard build frontend (pip, build, fromager) that started from the sdist shipped
an empty
_proto/directory and failed atimport openshell._proto.Heads up on the diff size: the +7k lines are almost entirely the 15 auto-generated
protobuf stubs (
*_pb2.py,*_pb2_grpc.py,*.pyi) that were previously gitignoredand only existed as transient build artifacts.
This PR promotes them to tracked files so they ship in the sdist. The actual project
changes (gitignore, pyproject.toml, CI workflow, mise task, docs) are under 50 lines.
Future PRs that touch .proto files will only show the regenerated diff for the affected
stubs, not the full set.
Related Issue
Closes#2596
Changes
.gitignorerules that excludedpython/openshell/_proto/**_pb2.py,*_pb2_grpc.py,*.pyi)[tool.maturin].includeglobs that were a workaround for thegitignored stubs (maturin now discovers them normally via
python-source)python:proto:checkmise task that regenerates stubs and runsgit diff --exit-codeto catch stalenessbranch-checks.yml(Python job) and thelinttask (somise run pre-commitcatches it locally)architecture/build.mdandCONTRIBUTING.mdwith the new workflowNote on determinism
The generated output is identical across Python versions (tested 3.12 vs 3.14)
because
grpcio-toolsis pinned viauv.lock. Contributors regenerate withmise run python:protoafter changing any.protofile and commit the result.Testing
mise run pre-commitpassestar tzfinspection)unzip -l)Checklist