Skip to content
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

feat: enable dynamic loading in Python main app #502

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions core/src/ten_runtime/binding/python/interface/ten/ten_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from libten_runtime_python import _Extension, _TenEnv
from .error import TenError
from .ten_env_attach_to_enum import _TenEnvAttachTo
from .cmd_result import CmdResult
from .cmd import Cmd
from .video_frame import VideoFrame
Expand Down Expand Up @@ -43,19 +42,6 @@ def _on_release(self) -> None:
self._release_handler()

def on_configure_done(self) -> None:
from .addon_manager import _AddonManager

if self._internal._attach_to == _TenEnvAttachTo.APP:
# Load all python addons when app on_configure_done.
_AddonManager.load_all_addons()

# In the current use of the TEN framework's Python environment,
# there is no need to pass any `register_ctx` object into the
# register handler of the Python addon. Therefore, for now, simply
# passing `None` is sufficient. If needed in the future, we can
# consider what information should be passed to the register
# handler of the Python addon.
_AddonManager.register_all_addons(None)
return self._internal.on_configure_done()

def on_init_done(self) -> None:
Expand Down
5 changes: 5 additions & 0 deletions core/src/ten_runtime/binding/python/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"type": "system",
"name": "ten_runtime",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
}
],
"package": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
"name": "default_extension_python",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
},
{
"type": "extension",
"name": "simple_echo_cpp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
"name": "default_extension_python",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
},
{
"type": "extension",
"name": "simple_echo_cpp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
"name": "default_extension_python",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
},
{
"type": "extension",
"name": "simple_echo_cpp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
"name": "default_extension_python",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
},
{
"type": "extension",
"name": "simple_echo_cpp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
"name": "default_extension_python",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
},
{
"type": "extension",
"name": "simple_echo_cpp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
"name": "default_extension_python",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
},
{
"type": "extension",
"name": "simple_echo_cpp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
"name": "default_extension_python",
"version": "0.6.0"
},
{
"type": "addon_loader",
"name": "python_addon_loader",
"version": "0.6.0"
},
{
"type": "extension",
"name": "simple_echo_cpp",
Expand Down
Loading