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: add nodejs addon loader #544

Closed
Closed
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bf5a9ff
feat: add nodejs addon loader
sunxilin Jan 10, 2025
2cd2445
Merge branch 'main' into 512-support-embedding-nodejs-into-other-exec…
halajohn Jan 12, 2025
5302768
fix: download prebuilt libnode from github release
sunxilin Jan 13, 2025
0f74487
feat: enable multiple pytest cases in core python extensions
halajohn Jan 12, 2025
69bbf54
feat: refine C++ extension standalone test building (#548)
halajohn Jan 12, 2025
50b03b6
feat: refine C++ extension standalone test building (#549)
halajohn Jan 13, 2025
d133f77
chore: update github CI scripts
halajohn Jan 13, 2025
32b4e23
fix: complete PYTHONPATH for standalone testing (#551)
sunxilin Jan 13, 2025
4b66f08
fix: add correct PYTHONPATH in python standalone test (#552)
halajohn Jan 13, 2025
8fd8f48
fix: github CI action of linux for uploading to TEN cloud store
halajohn Jan 13, 2025
5013eaa
feat: have an env variable to control if terminal log has color (#554)
halajohn Jan 13, 2025
cf75ae3
feat: add log api in Python tester (#553)
sunxilin Jan 13, 2025
10ebfd9
chore: update version number
halajohn Jan 13, 2025
e754916
chore: remove condition wait in log api in Python (#555)
sunxilin Jan 13, 2025
fdfc953
Merge remote-tracking branch 'origin/main' into 512-support-embedding…
sunxilin Jan 14, 2025
496e28a
fix: manage libnode prebuilt shared lib
sunxilin Jan 16, 2025
7211751
Merge branch 'main' into 512-support-embedding-nodejs-into-other-exec…
sunxilin Jan 18, 2025
aa17d44
fix: handle symbolic link file for tman packaging (#566)
halajohn Jan 18, 2025
2773804
Merge remote-tracking branch 'origin/main' into 512-support-embedding…
sunxilin Jan 18, 2025
e510f6f
fix: dlopen libnode in nodejs addon loader
sunxilin Jan 18, 2025
b90a456
Merge branch 'main' into 512-support-embedding-nodejs-into-other-exec…
sunxilin Jan 20, 2025
f9f6ae2
fix: rebase
sunxilin Jan 21, 2025
0c3f183
Merge branch 'main' into 512-support-embedding-nodejs-into-other-exec…
halajohn Jan 21, 2025
c91e6ac
Merge branch 'main' into 512-support-embedding-nodejs-into-other-exec…
halajohn Jan 23, 2025
61c8388
chore: refine github win CI script
halajohn Jan 24, 2025
be67436
feat: add msg pointer in send_xxx callback (#599)
halajohn Jan 24, 2025
16c54a4
feat: add log viewer component (#600)
shczhen Jan 24, 2025
4640147
chore: remove unnecessary files
halajohn Jan 24, 2025
b7f19f2
feat: add msg pointer in send_xxx callback (#601)
halajohn Jan 24, 2025
e4926b3
feat: add msg pointer in send_xxx callback (#602)
halajohn Jan 24, 2025
727fb10
feat: add msg pointer in send_xxx callback (#603)
halajohn Jan 24, 2025
813753b
feat: add msg pointer in send_xxx callback (#604)
halajohn Jan 25, 2025
fb2e7a9
feat: add msg pointer in send_xxx callback (#606)
halajohn Jan 25, 2025
c180868
feat: add run menu item in tman designer frontend (#608)
halajohn Jan 25, 2025
ca42cc1
chore: refine the internal of send_cmd and send_cmd_ex (#607)
halajohn Jan 25, 2025
a87f04e
feat: enable app execution and get log in tman designer (#609)
halajohn Jan 25, 2025
a3e3572
chore: update to latest git submodules
halajohn Jan 25, 2025
67d7eb5
Merge branch 'main' into 512-support-embedding-nodejs-into-other-exec…
halajohn Jan 25, 2025
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
Prev Previous commit
Next Next commit
fix: complete PYTHONPATH for standalone testing (#551)
Co-authored-by: Hu Yueh-Wei <[email protected]>
sunxilin and halajohn committed Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 32b4e239c68533b9409fdf7f796bb80611d94f19
28 changes: 24 additions & 4 deletions core/src/ten_runtime/binding/python/interface/ten/test.py
Original file line number Diff line number Diff line change
@@ -67,10 +67,6 @@ def stop_test(self) -> None:


class ExtensionTester(_ExtensionTester):
@final
def _on_test_app_configure(self, ten_env_tester: TenEnvTester) -> None:
self.on_start(ten_env_tester)

@final
def set_test_mode_single(
self, addon_name: str, property_json_str: Optional[str] = None
@@ -83,20 +79,44 @@ def set_test_mode_single(
def run(self) -> None:
return _ExtensionTester.run(self)

@final
def _proxy_on_start(self, ten_env_tester: TenEnvTester) -> None:
self.on_start(ten_env_tester)

def on_start(self, ten_env_tester: TenEnvTester) -> None:
ten_env_tester.on_start_done()

@final
def _proxy_on_cmd(self, ten_env_tester: TenEnvTester, cmd: Cmd) -> None:
self.on_cmd(ten_env_tester, cmd)

def on_cmd(self, ten_env_tester: TenEnvTester, cmd: Cmd) -> None:
pass

@final
def _proxy_on_data(self, ten_env_tester: TenEnvTester, data: Data) -> None:
self.on_data(ten_env_tester, data)

def on_data(self, ten_env_tester: TenEnvTester, data: Data) -> None:
pass

@final
def _proxy_on_audio_frame(
self, ten_env_tester: TenEnvTester, audio_frame: AudioFrame
) -> None:
self.on_audio_frame(ten_env_tester, audio_frame)

def on_audio_frame(
self, ten_env_tester: TenEnvTester, audio_frame: AudioFrame
) -> None:
pass

@final
def _proxy_on_video_frame(
self, ten_env_tester: TenEnvTester, video_frame: VideoFrame
) -> None:
self.on_video_frame(ten_env_tester, video_frame)

def on_video_frame(
self, ten_env_tester: TenEnvTester, video_frame: VideoFrame
) -> None:
Original file line number Diff line number Diff line change
@@ -80,8 +80,8 @@ static void proxy_on_start(ten_extension_tester_t *extension_tester,
TEN_ASSERT(py_ten_env_tester->c_ten_env_tester_proxy, "Should not happen.");

PyObject *py_res =
PyObject_CallMethod((PyObject *)py_extension_tester, "on_start", "O",
py_ten_env_tester->actual_py_ten_env_tester);
PyObject_CallMethod((PyObject *)py_extension_tester, "_proxy_on_start",
"O", py_ten_env_tester->actual_py_ten_env_tester);
Py_XDECREF(py_res);

bool err_occurred = ten_py_check_and_clear_py_error();
@@ -151,7 +151,7 @@ static void proxy_on_cmd(ten_extension_tester_t *extension_tester,
ten_py_cmd_t *py_cmd = ten_py_cmd_wrap(cmd);

PyObject *py_res = PyObject_CallMethod(
(PyObject *)py_extension_tester, "on_cmd", "OO",
(PyObject *)py_extension_tester, "_proxy_on_cmd", "OO",
((ten_py_ten_env_tester_t *)py_ten_env_tester)->actual_py_ten_env_tester,
py_cmd);
Py_XDECREF(py_res);
@@ -194,7 +194,7 @@ static void proxy_on_data(ten_extension_tester_t *extension_tester,
ten_py_data_t *py_data = ten_py_data_wrap(data);

PyObject *py_res = PyObject_CallMethod(
(PyObject *)py_extension_tester, "on_data", "OO",
(PyObject *)py_extension_tester, "_proxy_on_data", "OO",
((ten_py_ten_env_tester_t *)py_ten_env_tester)->actual_py_ten_env_tester,
py_data);
Py_XDECREF(py_res);
@@ -238,7 +238,7 @@ static void proxy_on_audio_frame(ten_extension_tester_t *extension_tester,
ten_py_audio_frame_t *py_audio_frame = ten_py_audio_frame_wrap(audio_frame);

PyObject *py_res = PyObject_CallMethod(
(PyObject *)py_extension_tester, "on_audio_frame", "OO",
(PyObject *)py_extension_tester, "_proxy_on_audio_frame", "OO",
((ten_py_ten_env_tester_t *)py_ten_env_tester)->actual_py_ten_env_tester,
py_audio_frame);
Py_XDECREF(py_res);
@@ -282,7 +282,7 @@ static void proxy_on_video_frame(ten_extension_tester_t *extension_tester,
ten_py_video_frame_t *py_video_frame = ten_py_video_frame_wrap(video_frame);

PyObject *py_res = PyObject_CallMethod(
(PyObject *)py_extension_tester, "on_video_frame", "OO",
(PyObject *)py_extension_tester, "_proxy_on_video_frame", "OO",
((ten_py_ten_env_tester_t *)py_ten_env_tester)->actual_py_ten_env_tester,
py_video_frame);
Py_XDECREF(py_res);
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
from pathlib import Path
from typing import Optional
from ten import (
ExtensionTester,
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
from pathlib import Path
from typing import Optional
from ten import (
ExtensionTester,
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
from pathlib import Path
from typing import Optional
from ten import (
ExtensionTester,
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
from pathlib import Path
from typing import Optional
from ten import (
ExtensionTester,
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
from pathlib import Path
import threading
from typing import Optional
from ten import (
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
from pathlib import Path
from typing import Optional
from ten import (
ExtensionTester,