Skip to content

fix(python): include generated proto stubs in Linux wheels#2029

Merged
maxdubrinsky merged 1 commit into
mainfrom
1705-linux-wheel-proto-files/md
Jun 26, 2026
Merged

fix(python): include generated proto stubs in Linux wheels#2029
maxdubrinsky merged 1 commit into
mainfrom
1705-linux-wheel-proto-files/md

Conversation

@maxdubrinsky

Copy link
Copy Markdown
Collaborator

Summary

The openshell Linux wheels (0.0.54) shipped without the generated protobuf/gRPC stubs under openshell/_proto/, so importing the package failed immediately on Linux. This pins those generated modules into the wheel and adds a wheel import smoke check to the release pipelines so the regression can't ship again.

Related Issue

Closes #1705

Changes

  • Root cause fix (pyproject.toml): add explicit, package-relative [tool.maturin].include globs for the openshell/_proto/*_pb2.py, *_pb2_grpc.py, and *.pyi stubs. These files are gitignored build outputs of mise run python:proto; maturin honors .gitignore when collecting python-source files from a git checkout, so native builds (Linux release CI, local pip install .) dropped them. The macOS wheel only included them by accident — it builds in a Docker context whose COPY omits .git, so maturin had no gitignore to apply. The explicit include makes inclusion independent of .git presence.
  • Release smoke (.github/workflows/release-tag.yml, release-dev.yml): add a wheel matrix entry (amd64 + arm64) to the existing Linux smoke jobs that installs each built wheel in a clean python:3.12-slim image and imports openshell, openshell._proto, and openshell.sandbox.
  • Docs (architecture/build.md): document the gitignored-stub / maturin invariant and the wheel smoke check.

Testing

  • mise run pre-commit passes (full lint + check + test; Rust and Python suites green — test:python 58 passed, test:rust/test:sbom/test:docs-website/test:install-sh/test:packaging-assets all pass)
  • Reproduced the bug and verified the fix locally: a maturin build inside the git repo dropped the stubs before the change and includes all 12 after; a clean pip install of the fixed wheel imports openshell.sandbox successfully
  • Unit tests added/updated — N/A by design; coverage is the CI wheel install+import smoke rather than a unit test
  • E2E tests added/updated — N/A

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

The generated protobuf/gRPC modules under python/openshell/_proto/ are
gitignored. maturin honors .gitignore when collecting python-source files
from a git checkout, so native builds (Linux release CI, local
pip install .) dropped these modules and shipped an unimportable wheel.
The macOS wheel only included them by accident: it builds in a Docker
context whose COPY omits .git, so maturin had no gitignore to apply.

Pin the stubs back in with explicit, package-relative
[tool.maturin].include globs so inclusion no longer depends on whether
.git is present in the build context.

Add a wheel smoke check to the release-tag and release-dev workflows that
installs each Linux wheel in a clean python:3.12-slim image and imports
openshell.sandbox, and document the invariant in architecture/build.md.

Closes #1705

Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
@github-actions

Copy link
Copy Markdown

Comment thread .github/workflows/release-tag.yml
@maxdubrinsky maxdubrinsky merged commit 8c78459 into main Jun 26, 2026
33 checks passed
@maxdubrinsky maxdubrinsky deleted the 1705-linux-wheel-proto-files/md branch June 26, 2026 22:23
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.

Linux wheels for 0.0.54 are missing openshell/_proto/*_pb2.py files present in macOS wheel

2 participants