Skip to content

chore: Ensure Rust and Python package versions are always in sync - #40

Closed
dagardner-nv wants to merge 10 commits into
mainfrom
david-version-syncs
Closed

chore: Ensure Rust and Python package versions are always in sync#40
dagardner-nv wants to merge 10 commits into
mainfrom
david-version-syncs

Conversation

@dagardner-nv

@dagardner-nv dagardner-nv commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Overview

  • Remove setuptools-scm and setuptools_dynamic_dependencies from the setuptools-based Python packages. The reason is that Cargo and Maturin don't have the ability to infer the version from a git tag. This caused the nemo-fabric-runtime package to have a slightly different version
  • Adopt the set-version Just recipe from Relay to automate setting/updating version strings
  • Adopt Relay's update-project-version skill

Where should the reviewer start?

Start with the set-version recipe and its helper functions in justfile, then review .agents/skills/update-project-version/SKILL.md for the intended release workflow.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Relates to: FABRIC-57

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.

  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Summary by CodeRabbit

  • New Features

    • Added a standardized version update workflow for the project, helping keep release versions consistent across components.
    • Version information now reflects the installed package metadata when available, instead of always showing a fixed value.
  • Bug Fixes

    • Improved package version handling so release and dependency versions stay aligned across the app and adapters.

… there was no equivelant in Cargo

Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
…abric/integrations/harbor/__init__.py

Signed-off-by: David Gardner <dagardner@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 66319abb-1c7d-46db-8d24-431ab1bcd288

📥 Commits

Reviewing files that changed from the base of the PR and between 0a6e421 and b0d7dd8.

📒 Files selected for processing (3)
  • .agents/skills/update-project-version/SKILL.md
  • justfile
  • python/src/nemo_fabric/integrations/harbor/__init__.py
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
python/src/nemo_fabric/**/*

⚙️ CodeRabbit configuration file

python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/src/nemo_fabric/integrations/harbor/__init__.py
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-08T23:08:30.234Z
Learning: When changing the NeMo Fabric version, use valid Cargo SemVer in `Cargo.toml` and equivalent PEP 440 versions in explicit Python metadata, and confirm the Maturin-built runtime and setuptools-built packages resolve to equivalent versions.
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-08T23:08:30.234Z
Learning: If editing the helper code, keep the `set_project_version`, `set_cargo_workspace_version`, `set_python_project_versions`, and `set-version` recipe contracts aligned.
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-08T23:08:30.234Z
Learning: Use `just set-version <cargo-version>` to update source metadata, then run `just lock-python` afterward.
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.

Applied to files:

  • python/src/nemo_fabric/integrations/harbor/__init__.py
🔇 Additional comments (3)
python/src/nemo_fabric/integrations/harbor/__init__.py (1)

57-60: LGTM!

justfile (1)

179-197: LGTM!

.agents/skills/update-project-version/SKILL.md (1)

40-58: 📐 Maintainability & Code Quality | ⚡ Quick win

Clarify build-metadata handling in just set-version.

The intro says this skill covers build-metadata versions, but the workflow only documents prerelease conversion. If build metadata is unsupported, narrow the scope here; otherwise document the exact just set-version behavior for those versions so release steps stay unambiguous.


Walkthrough

Switches Python packaging from dynamic version generation to static pinned versions, adds just set-version automation for synchronized Rust/Python updates, changes Harbor version lookup to runtime metadata, and adds workflow documentation.

Changes

Static version pinning and automation

Layer / File(s) Summary
Root pyproject.toml static versioning
pyproject.toml
Build requirements are reduced, project versioning becomes static, optional dependency pins are hardcoded, and setuptools SCM/dynamic dependency config is removed.
Adapter package pyproject.toml static versioning
adapters/common/pyproject.toml, adapters/codex-cli/pyproject.toml, adapters/hermes-cli/pyproject.toml, adapters/hermes-sdk/pyproject.toml
Adapter packages switch to fixed 0.1.0 versions and explicit dependency lists, with local uv.sources overrides for nemo-fabric-adapters-common.
Harbor integration dynamic version lookup
python/src/nemo_fabric/integrations/harbor/__init__.py
FabricAgent.version() now reads nemo-fabric-runtime metadata with importlib.metadata and returns None when unavailable.
justfile version synchronization helpers and set-version target
justfile
Adds version conversion and rewrite helpers, Cargo and Python version synchronization, and a set-version target that falls back to ref_name and runs just lock-python.
update-project-version skill documentation
.agents/skills/update-project-version/SKILL.md
Adds documented rules, workflow steps, validation commands, and file references for updating project versions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • NVIDIA/NeMo-Fabric#38: Touches the same adapter packaging and version/dependency setup that this PR converts to static pinning.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses Conventional Commits, is concise, and accurately summarizes the version-sync change.
Description check ✅ Passed The description follows the template with Overview, reviewer start point, related issue, and required confirmations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch david-version-syncs

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

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

@dagardner-nv dagardner-nv changed the title chore: synchronize Rust and Python package versions chore: Ensure Rust and Python package versions are always in sync Jul 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/update-project-version/SKILL.md:
- Around line 54-58: The skill docs still mention patching
FabricAgent.version(), but Harbor integration now reads version dynamically via
importlib.metadata so that step is obsolete. Update the update-project-version
guide and the referenced set_harbor_integration_version / just set-version flow
to remove any FabricAgent.version() patching language, and align the documented
steps with the current helper names and behavior in the justfile and SKILL.md.

In `@justfile`:
- Around line 241-277: Remove the obsolete Harbor version patching flow from the
justfile: `set_harbor_integration_version` now targets a literal return value
that no longer exists in
`python/src/nemo_fabric/integrations/harbor/__init__.py`, so it will always
fail. Delete that helper and stop calling it from `set_project_version`, keeping
only the remaining version update steps (`set_cargo_workspace_version` and
`set_python_project_versions`) aligned with the current Harbor `version()`
implementation.

In `@python/src/nemo_fabric/integrations/harbor/__init__.py`:
- Around line 56-60: The Harbor integration version method now reads dynamically
from importlib.metadata.version in version(self), so the justfile’s
version-patching regex no longer matches and breaks just set-version. Update the
related set_harbor_integration_version logic to stop patching this method
entirely and instead rely on the runtime-derived version, keeping the dynamic
importlib.metadata.version / PackageNotFoundError implementation as-is.
- Around line 57-60: The Harbor version lookup in the version() helper is
querying the wrong distribution name, so it can’t find the installed wheel for
this module. Update the importlib.metadata.version call in the version()
function to use the runtime distribution name built by the package, and keep the
PackageNotFoundError fallback so the helper still returns None when the
distribution is absent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: dbc03d3a-aaf5-4d66-9b06-7d197dd01156

📥 Commits

Reviewing files that changed from the base of the PR and between 4252cfe and 0a6e421.

⛔ Files ignored due to path filters (5)
  • adapters/codex-cli/uv.lock is excluded by !**/*.lock
  • adapters/common/uv.lock is excluded by !**/*.lock
  • adapters/hermes-cli/uv.lock is excluded by !**/*.lock
  • adapters/hermes-sdk/uv.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • .agents/skills/update-project-version/SKILL.md
  • adapters/codex-cli/pyproject.toml
  • adapters/common/pyproject.toml
  • adapters/hermes-cli/pyproject.toml
  • adapters/hermes-sdk/pyproject.toml
  • justfile
  • pyproject.toml
  • python/src/nemo_fabric/integrations/harbor/__init__.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
python/src/nemo_fabric/**/*

⚙️ CodeRabbit configuration file

python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/src/nemo_fabric/integrations/harbor/__init__.py
{pyproject.toml,adapters/**/pyproject.toml}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

{pyproject.toml,adapters/**/pyproject.toml}: For the setuptools-built Python packages, update the literal project.version in the root pyproject.toml and in every adapters/**/pyproject.toml.
Keep internal Python dependency pins aligned with the Python release version: all nemo-fabric-* == <version> requirements in the root pyproject.toml optional dependencies, and each adapter's nemo-fabric-adapters-common == <version> dependency.

Files:

  • adapters/hermes-cli/pyproject.toml
  • adapters/codex-cli/pyproject.toml
  • adapters/common/pyproject.toml
  • adapters/hermes-sdk/pyproject.toml
  • pyproject.toml
{adapters/**,examples/**}

⚙️ CodeRabbit configuration file

{adapters/**,examples/**}: Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public Fabric contracts.

Files:

  • adapters/hermes-cli/pyproject.toml
  • adapters/codex-cli/pyproject.toml
  • adapters/common/pyproject.toml
  • adapters/hermes-sdk/pyproject.toml
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-08T22:53:23.074Z
Learning: For normal releases, use the same `X.Y.Z` version string everywhere; for prerelease or build-metadata releases, use valid Cargo SemVer in `Cargo.toml` and the equivalent PEP 440 version in explicit Python metadata, and ensure the Maturin-built runtime and setuptools-built packages resolve to equivalent versions.
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-08T22:53:23.074Z
Learning: When changing the project version, follow the prescribed workflow: read the current version from `Cargo.toml`, run `just set-version <cargo-version>`, keep `python/pyproject.toml` unchanged and dynamic, audit old-version references, and run the specified validation commands (including `cargo check --workspace --locked`, `just build-python`, `just test-python` when relevant, `just wheels` when release-facing, and `git diff --check`).
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-08T22:53:23.074Z
Learning: If editing helper code, keep `set_project_version`, `set_cargo_workspace_version`, `set_python_project_versions`, `set_harbor_integration_version`, and the `set-version` recipe aligned with the documented version-update contracts.
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-08T22:53:23.074Z
Learning: Avoid partial or blind version updates: do not update only `Cargo.toml`, do not add a literal version to `python/pyproject.toml`, do not update Python package versions without their exact internal pins, and do not forget `Cargo.lock` or the relevant `uv.lock` files.
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.

Applied to files:

  • python/src/nemo_fabric/integrations/harbor/__init__.py
🪛 LanguageTool
.agents/skills/update-project-version/SKILL.md

[uncategorized] ~40-~40: Do not mix variants of the same word (‘prerelease’ and ‘pre-release’) within a single text.
Context: ...e same X.Y.Z string everywhere. For a prerelease or build-metadata version, use valid Ca...

(EN_WORD_COHERENCY)


[uncategorized] ~51-~51: Do not mix variants of the same word (‘prerelease’ and ‘pre-release’) within a single text.
Context: ...cipe converts supported Cargo SemVer prereleases to PEP 440 and updates: - `Cargo.tom...

(EN_WORD_COHERENCY)


[style] ~87-~87: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...all Python package metadata resolves. - Run just test-python when the integration...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~90-~90: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ing validation of every Python wheel. - Run git diff --check. ## Avoid - Updati...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (10)
pyproject.toml (1)

4-16: LGTM!

Also applies to: 20-59, 98-98

adapters/common/pyproject.toml (1)

4-18: LGTM!

adapters/codex-cli/pyproject.toml (1)

12-19: LGTM!

adapters/hermes-cli/pyproject.toml (1)

12-20: LGTM!

adapters/hermes-sdk/pyproject.toml (1)

12-19: LGTM!

justfile (4)

15-64: LGTM!


65-177: LGTM!


179-239: LGTM!


330-345: LGTM!

.agents/skills/update-project-version/SKILL.md (1)

1-111: LGTM!

Comment thread .agents/skills/update-project-version/SKILL.md Outdated
Comment thread justfile Outdated
Comment thread python/src/nemo_fabric/integrations/harbor/__init__.py
Comment thread python/src/nemo_fabric/integrations/harbor/__init__.py
@linear

linear Bot commented Jul 8, 2026

Copy link
Copy Markdown

Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
@dagardner-nv
dagardner-nv deleted the david-version-syncs branch July 17, 2026 18:01
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