Repository navigation
feat(template)!: name holoscan.<slug> as the Module Python namespace - #295
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
wyli
left a comment
There was a problem hiding this comment.
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:
- The
repo_prefixchange renames images and containers for an existing Module whosemodule.namespace.pythonis dotted and which doesn't setrepo-prefix(holoscan.xnow givesholoscan_xinstead ofx). 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. - 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.
|
Thanks @wyli.
Follow-up: agreed, Merge order: once #296 lands, I'll rebase this PR on it. I'll keep #296's removal of the |
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>
db52431 to
250f376
Compare
|
Rebased on
After the rebase, unit tests pass (771 passed, 1 skipped), as do pre-commit and Ruff on the generated Modules. In |
wyli
left a comment
There was a problem hiding this comment.
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.
Summary
Generated Modules (
--language cpp pythonand--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 existingholoscan.modulesentry point (#273, #275, #284) maps the dotted name to it.CLI consumer of
module.namespace.python._module_identity()used to take the last dotted segment asrepo_prefix, soholoscan.my_sensorwould have givenmy_sensorand an image prefix ofmy-sensor. It now joins the segments with_. Bothholoscan.my_sensorandholoscan_my_sensorgiveholoscan_my_sensor, so the container prefix staysholoscan-my-sensor.[tool.holoscan] repo-prefixnow getsholoscan_<x>instead of<x>. Holoscan Camera is unaffected because it already setsrepo-prefix = "holoscan_camera". Metadata without a Python namespace still falls back tomodule.nameas before.CONFIGURATION.md.Rebased on #296, which moved pure-Python operator sources to
operators/<op>/, socreate'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-commiton the changed files passes.format --checkandcheckpass on generatedcpp pythonandpythonModules.holoscan:v5.0.0-cuda13(runc, no GPU):cpp pythonModule passes 7/7 generated pytest cases and the pure-Python Module passes 5/5. CTest passes for both.cmake --install. The install check ran with the source and build trees moved away.Before the rebase, the wheel build,
smoke_test.shandholoscan 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