Skip to content

feat(template)!: name holoscan.<slug> as the Module Python namespace - #295

Merged
wyli merged 2 commits into
mainfrom
devin/1793999567-module-dotted-namespace
Nov 8, 2026
Merged

wyli merged 2 commits into
mainfrom
devin/1793999567-module-dotted-namespace

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Generated Modules (--language cpp python and --language python) now declare the dotted Python namespace and import it in their docs and examples. The SDK modules (holoscan.vision, …) and Holoscan Camera (holoscan.camera) already use this form. holoscan_<slug> stays as the implementation package, and the existing holoscan.modules entry point (#273, #275, #284) maps the dotted name to it.

 // metadata.json
-"python": "holoscan_my_sensor"
+"python": "holoscan.my_sensor"

 # README / DEVELOPER.md / example pipeline / generated tests
-from holoscan_my_sensor.operators import MySensorOp
+from holoscan.my_sensor.operators import MySensorOp

CLI consumer of module.namespace.python. _module_identity() used to take the last dotted segment as repo_prefix, so holoscan.my_sensor would have given my_sensor and an image prefix of my-sensor. It now joins the segments with _. Both holoscan.my_sensor and holoscan_my_sensor give holoscan_my_sensor, so the container prefix stays holoscan-my-sensor.

  • Behavior change: an existing project with dotted metadata and no [tool.holoscan] repo-prefix now gets holoscan_<x> instead of <x>. Holoscan Camera is unaffected because it already sets repo-prefix = "holoscan_camera". Metadata without a Python namespace still falls back to module.name as before.
  • The fallback is documented in CONFIGURATION.md.

Rebased on #296, which moved pure-Python operator sources to operators/<op>/, so create's "next steps" no longer reads the namespace.

Generated tests. A new test_import_orders_load_one_package[holoscan.<slug> | holoscan_<slug>] imports the two names in each order in a fresh interpreter. It asserts that both give the same module object and the same operator class.

Validation (after the rebase on 61581b4)

  • tests/unit: 771 passed, 1 skipped.
  • pre-commit on the changed files passes.
  • Ruff 0.15.17 format --check and check pass on generated cpp python and python Modules.
  • In holoscan:v5.0.0-cuda13 (runc, no GPU):
    • The cpp python Module passes 7/7 generated pytest cases and the pure-Python Module passes 5/5. CTest passes for both.
    • Both import orders resolve to the same package from the build tree and from cmake --install. The install check ran with the source and build trees moved away.

Before the rebase, the wheel build, smoke_test.sh and holoscan env-info (HOLOSCAN_CLI_CONTAINER_PREFIX: holoscan-my-sensor / holoscan-my-pysensor) also passed. They weren't rerun after it.

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/d1036913a1944b97a73dc7eca0d79078
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/d1036913a1944b97a73dc7eca0d79078?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@copy-pr-bot

copy-pr-bot Bot commented Nov 6, 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.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@tbirdso
tbirdso marked this pull request as ready for review November 6, 2026 21:40
@tbirdso
tbirdso requested review from jcfr and wyli November 6, 2026 21:40
@tbirdso tbirdso self-assigned this Nov 6, 2026

@wyli wyli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Checked at c55cffb. Unit tests pass, and an end-to-end run on a GPU host with holoscan:v5.0.0-cuda13 passed for both a cpp python and a --language python Module: create, build, run, CTest including the generated Python tests, install --dev, the wheel package, and the wheel consumer.

Requests:

  1. The repo_prefix change renames images and containers for an existing Module whose module.namespace.python is dotted and which doesn't set repo-prefix (holoscan.x now gives holoscan_x instead of x). The PR body says so already. Please also mark the title as breaking (feat(template)!: …) so the squash commit and the release notes flag it.
  2. A DEVELOPER.md wording fix; see the inline comment.

Follow-up, not for this PR: a --language cpp Module has no Python namespace, so its prefix comes from module.name (my_sensor). The same Module with Python gets holoscan_my_sensor, so adding bindings later renames its images.

Merge order: this PR conflicts with #296 in create.py and the template DEVELOPER.md. I suggest landing #296 first. Rebasing this PR then means keeping #296's removal of the create.py namespace block and its new operator location in DEVELOPER.md.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Thanks @wyli.

  1. The title now carries the breaking marker: feat(template)!: ….
  2. The DEVELOPER.md wording is applied in db52431.

Follow-up: agreed, --language cpp falls back to module.name (my_sensor), so adding bindings later renames its images. That belongs in a separate change.

Merge order: once #296 lands, I'll rebase this PR on it. I'll keep #296's removal of the create.py namespace block and its new operator location in DEVELOPER.md.

@devin-ai-integration devin-ai-integration Bot changed the title feat(template): name holoscan.<slug> as the Module Python namespace feat(template)!: name holoscan.<slug> as the Module Python namespace Nov 8, 2026
@wyli

wyli commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

#296 is merged (61581b4). Please rebase this PR on main as planned: keep #296's removal of the create.py namespace block and its operator location in the template DEVELOPER.md.

Generated C++/Python and pure-Python Modules now declare
module.namespace.python as holoscan.<slug>, the form the SDK modules and
Holoscan Camera use, and their README, DEVELOPER.md, example pipeline and
tests import holoscan.<slug>. The holoscan_<slug> package still implements
the Module; its holoscan.modules entry point maps holoscan.<slug> to it.

The default repository prefix now joins the namespace segments with "_",
so holoscan.<slug> and holoscan_<slug> both give holoscan_<slug> and the
container prefix stays holoscan-<slug>. create prints the pure-Python
operator directory under python/holoscan_<slug>. The generated tests
check both import orders in fresh interpreters.

Signed-off-by: Tom Birdsong <tbirdsong@nvidia.com>
Assisted-by: Devin AI
Assisted-by: Devin AI
Signed-off-by: Tom Birdsong <tbirdsong@nvidia.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1793999567-module-dotted-namespace branch from db52431 to 250f376 Compare November 8, 2026 09:17
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Rebased on 61581b4 (now 250f376), as planned:

After the rebase, unit tests pass (771 passed, 1 skipped), as do pre-commit and Ruff on the generated Modules. In holoscan:v5.0.0-cuda13, the cpp python Module passes 7/7 generated pytest cases and the pure-Python Module (operators/my_pysensor_op/) passes 5/5. Both import orders work from the build tree and from the install.

@wyli wyli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks. The rebase onto main matches the reviewed change, unit tests pass, and generated python and cpp python Modules build, test and run with the holoscan.<slug> namespace.

@wyli
wyli merged commit 80ca5ef into main Nov 8, 2026
35 of 42 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/1793999567-module-dotted-namespace branch November 10, 2026 13:57
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