Skip to content

fix(packaging): include prefill-router in the Python sdist - #706

Merged
ayushag-nv merged 1 commit into
mainfrom
nachiketb/fix-python-sdist-prefill-router
Sep 15, 2026
Merged

ayushag-nv merged 1 commit into
mainfrom
nachiketb/fix-python-sdist-prefill-router

Conversation

@nachiketb-nvidia

@nachiketb-nvidia nachiketb-nvidia commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What

  • Include the optional prefill-router crate and the pinned Rust toolchain in Python source distributions.
  • Smoke install the generated source distribution before it can be uploaded.

Why

The generated archive contained switchyard-runner, but omitted its local prefill-router dependency. Cargo therefore failed during package metadata generation. The archive also omitted the repository's pinned toolchain, which could leave clean builds below the declared Rust version.

How

Maturin now includes only the prefill crate files needed to resolve and build the workspace dependency. The existing source-distribution job installs its generated archive in an isolated Python 3.10 environment and imports the native extension.

Validation

  • Built nemo_switchyard-0.2.0.tar.gz with Maturin.
  • Confirmed the archive contains the prefill manifest, build script, Rust sources, embedded Python source, and rust-toolchain.toml.
  • Installed that archive outside the checkout in an isolated Python 3.10 environment.
  • Imported switchyard_rust._switchyard_rust from the installed archive.
  • actionlint passed for the release workflow.

Fixes SWITCH-1427.

Summary by CodeRabbit

  • Chores

    • Source distributions now include all required build configuration and source files, improving reliability when building from source.
  • Tests

    • Added an automated smoke test that installs the source distribution in an isolated Python environment and verifies the compiled extension can be imported successfully.

Signed-off-by: nachiketb <nachiketb@nvidia.com>
@nachiketb-nvidia
nachiketb-nvidia requested a review from a team as a code owner September 15, 2026 18:55
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-706/

Built to branch gh-pages at 2026-09-15 18:56 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d7a53a5a-5fb2-4308-b399-18787872a473

📥 Commits

Reviewing files that changed from the base of the PR and between 3807ff0 and 9615475.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml
  • pyproject.toml

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


Walkthrough

The source distribution now includes required Rust build inputs. The publish workflow smoke-installs the distribution in isolated Python 3.10 and imports the Rust extension before upload.

Changes

Source Distribution Validation

Layer / File(s) Summary
Source distribution build inputs
pyproject.toml
The maturin source distribution includes the Rust toolchain and prefill-router files.
Source distribution smoke installation
.github/workflows/publish.yml
The workflow installs the source distribution in isolated Python 3.10 and imports switchyard_rust._switchyard_rust.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 96154

The source distribution includes the required build inputs and is smoke-installed and imported in isolation before upload.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: including the optional prefill-router crate in the Python source distribution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

A rabbit packs the Rust files tight
Into the source bundle overnight
Python hops into a clean new pen
The extension loads, then hops again
The publish path shines bright with delight

Comment @coderabbitai help to get the list of available commands.

Comment thread .github/workflows/publish.yml
@ayushag-nv
ayushag-nv enabled auto-merge (squash) September 15, 2026 20:28
@ayushag-nv
ayushag-nv disabled auto-merge September 15, 2026 20:28
@ayushag-nv
ayushag-nv enabled auto-merge (squash) September 15, 2026 20:28
@ayushag-nv
ayushag-nv self-requested a review September 15, 2026 20:28
@ayushag-nv
ayushag-nv merged commit 509d369 into main Sep 15, 2026
22 checks passed
@ayushag-nv
ayushag-nv deleted the nachiketb/fix-python-sdist-prefill-router branch September 15, 2026 20:29
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.

2 participants