Skip to content

fix(rpm): build the Python SDK from older protoc and install every SDK module - #4439

Merged
TaylorMutch merged 2 commits into
NVIDIA:mainfrom
politerealism:fix/3510-fedora-python-proto-stubs/politerealism
Oct 14, 2026
Merged

TaylorMutch merged 2 commits into
NVIDIA:mainfrom
politerealism:fix/3510-fedora-python-proto-stubs/politerealism

Conversation

@politerealism

@politerealism politerealism commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Three fixes to the RPM spec and the proto stub generator, found while checking the Fedora packaging items in #3510 (items 2 and 5).

Related Issue

Contributes to #3510

Changes

  • tasks/scripts/generate_python_proto.py: new --no-pyi option. The default is unchanged. Fedora's grpcio-tools 1.48.4 bundles protoc 3.19, which has no --pyi_out.
  • openshell.spec: add python3-googleapis-common-protos >= 1.63 and python3-httpx >= 0.27 to Recommends and to the dist-info Requires-Dist. Both are in pyproject.toml; without the first, import openshell fails on google.rpc.
  • openshell.spec: install errors.py, mutations.py, providers.py and py.typed. __init__.py and sandbox.py import the first three, so import openshell from an installed RPM failed with ModuleNotFoundError. %check only read importlib.metadata, so nothing caught it. A new %check step fails if any relative import in the installed package has no installed module. It is static because importing the package needs grpcio, which the build environment lacks.
  • openshell.spec: set License: to the minimal SPDX expression covering the crates linked into the shipped binaries (Apache-2.0 AND BSD-3-Clause AND CC0-1.0 AND CDLA-Permissive-2.0 AND ISC AND MIT AND Unicode-3.0 AND Zlib), keep the Python subpackage at Apache-2.0, and note how the non-crate content is covered.

Testing

  • On Fedora 44 in a container with distro packages only (grpcio-tools 1.48.4, protobuf 3.19.6): the default arguments fail with protoc-gen-pyi: Plugin failed; with --no-pyi all stubs generate and import openshell succeeds once the two packages are installed.
  • mise run python:lint passes (it regenerates the stubs with default arguments), and ruff format --check passes on the script.
  • The new %check step fails against the old install list and passes against the new one, run on a staged copy of the package.
  • The license expression was recomputed from cargo tree for openshell-cli, openshell-gateway and openshell-prover on x86_64 and aarch64 Linux (819 third-party crates, none without a license field).
  • Not tested: an rpmbuild of the spec, the SDK against a live gateway on grpcio 1.48, EPEL 10, Rawhide, or stub generation inside %build.

Checklist

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

@copy-pr-bot

copy-pr-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Add a --no-pyi option to generate_python_proto.py for toolchains whose protoc predates --pyi_out, such as Fedora's grpcio-tools 1.48, and list python3-googleapis-common-protos and python3-httpx in the spec's Recommends and dist-info Requires-Dist, which the SDK needs to import. Default behavior is unchanged. Contributes to NVIDIA#3510.

Signed-off-by: politerealism <burdcat17@gmail.com>
The python3-openshell %install copied only __init__.py, sandbox.py and
_proto/, but the package imports .errors, .mutations and .providers and ships a
py.typed marker, so an installed RPM could not import openshell. Install the
missing files and add a %check that fails if any relative import in the
installed package has no matching installed module. Importing the package needs
grpcio, which the build environment lacks, so the check is static.

Set License to the minimal SPDX expression covering every crate linked into the
shipped binaries, keep the pure-Python subpackage at Apache-2.0, and note how
the non-crate content is covered.

Signed-off-by: politerealism <burdcat17@gmail.com>
@politerealism
politerealism force-pushed the fix/3510-fedora-python-proto-stubs/politerealism branch from bc4e246 to dc7529f Compare October 13, 2026 14:14
@politerealism politerealism changed the title fix(python): let proto stub generation skip .pyi for older protoc fix(rpm): build the Python SDK from older protoc and install every SDK module Oct 13, 2026
@politerealism politerealism mentioned this pull request Oct 13, 2026
2 of 37 tasks
@politerealism
politerealism marked this pull request as ready for review October 14, 2026 16:33
@pimlock

pimlock commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

/ok to test dc7529f

1 similar comment
@purp

purp commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

/ok to test dc7529f

@TaylorMutch
TaylorMutch added this pull request to the merge queue Oct 14, 2026
Merged via the queue into NVIDIA:main with commit 36ee06f Oct 14, 2026
77 of 79 checks passed
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.

4 participants