Repository navigation
refactor(create): keep pure-Python operator sources in operators/<op>/ #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a42f976
refactor(create): keep pure-Python operator sources in operators/<op>/
tbirdso a02d09b
fix(template): stage and package only pure-Python operators enabled w…
tbirdso 8bfa3d1
feat(template): rebuild pure-Python editable installs on import
tbirdso c7cb56f
fix(template): expose pure-Python operators to type checkers
tbirdso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/operators/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
..._repo_name}}/operators/{% if cookiecutter.__pure_python == 'yes' %}__init__.py{% endif %}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) {% now 'utc', '%Y' %} {{ cookiecutter.full_name }}{% if cookiecutter.affiliation %} / {{ cookiecutter.affiliation }}{% endif %}. All rights reserved. | ||
| # SPDX-License-Identifier: {{ cookiecutter._license }} | ||
| {%- set op_class = cookiecutter.operator_slug.split('_')|map('capitalize')|join('') %} | ||
|
|
||
| """{{ cookiecutter.project_name }} operators. | ||
|
|
||
| Exports every operator package staged next to this file. The build and the wheel include an | ||
| operator only when its ``OP_<name>`` CMake option is ON. | ||
| """ | ||
|
|
||
| import importlib | ||
| import pkgutil | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
|
||
| from typing import TYPE_CHECKING | ||
|
|
||
| if TYPE_CHECKING: # one import per operator, for type checkers and IDEs | ||
| from .{{ cookiecutter.operator_slug }} import {{ op_class }} as {{ op_class }} | ||
|
|
||
| __all__: list[str] = [] | ||
| for _info in pkgutil.iter_modules(__path__): | ||
| _operator = importlib.import_module(f".{_info.name}", __name__) | ||
| for _name in getattr(_operator, "__all__", ()): | ||
| globals()[_name] = getattr(_operator, _name) | ||
| __all__.append(_name) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...cutter.operator_slug}}/{% if cookiecutter.__pure_python == 'yes' %}__init__.py{% endif %}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) {% now 'utc', '%Y' %} {{ cookiecutter.full_name }}{% if cookiecutter.affiliation %} / {{ cookiecutter.affiliation }}{% endif %}. All rights reserved. | ||
| # SPDX-License-Identifier: {{ cookiecutter._license }} | ||
| {%- set op_class = cookiecutter.operator_slug.split('_')|map('capitalize')|join('') %} | ||
|
|
||
| """The {{ op_class }} operator package.""" | ||
|
|
||
| from .{{ cookiecutter.operator_slug }} import {{ op_class }} | ||
|
|
||
| __all__ = ["{{ op_class }}"] |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.