From 2a4778d627aa3d3268248118d0381fde49a6f2c2 Mon Sep 17 00:00:00 2001 From: kirill-jjj Date: Wed, 17 Dec 2025 04:40:55 +0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix(build):=20restore=20on-i?= =?UTF-8?q?mport=20SDK=20download=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts to the previous mechanism of downloading the TeamTalk SDK automatically when the `pytalk` package is imported. This logic was removed in a previous refactor, but the explicit download step added to the CI was not implemented correctly, causing CI failures. Restoring this logic ensures the SDK is present before the type-checking and testing steps are run in the CI workflow. --- pytalk/__init__.py | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/pytalk/__init__.py b/pytalk/__init__.py index 6d2e818..5707480 100644 --- a/pytalk/__init__.py +++ b/pytalk/__init__.py @@ -1 +1,41 @@ -__version__ = "1.6.2.post12+g854d36b.d20251031" +__version__ = "0.0.0" + + +import os +import sys + +from ctypes import * + +try: + if sys.platform.startswith("linux"): + libpath = os.path.join( + os.path.dirname(__file__), + "implementation", + "TeamTalk_DLL", + "libTeamTalk5.so", + ) + dll = cdll.LoadLibrary(libpath) + from .implementation.TeamTalkPy import TeamTalk5 as sdk +except: + from .download_sdk import download_sdk + + download_sdk() + if sys.platform.startswith("linux"): + libpath = os.path.join( + os.path.dirname(__file__), + "implementation", + "TeamTalk_DLL", + "libTeamTalk5.so", + ) + dll = cdll.LoadLibrary(libpath) + from .implementation.TeamTalkPy import TeamTalk5 as sdk + +from .bot import TeamTalkBot +from .channel import Channel +from .user_account import UserAccount, BannedUserAccount +from .enums import Status, TeamTalkServerInfo, UserStatusMode, UserType +from .instance import TeamTalkInstance +from .message import BroadcastMessage, ChannelMessage, CustomMessage, DirectMessage +from .permission import Permission +from .streamer import Streamer +from .subscription import Subscription From 9864f812860553190242cd0862b330d7ff6ee715 Mon Sep 17 00:00:00 2001 From: kirill-jjj Date: Wed, 17 Dec 2025 04:46:30 +0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20style:=20apply=20pre-commit?= =?UTF-8?q?=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply formatting changes made by the `end-of-file-fixer` pre-commit hook to `tests/unit/test_bot.py`. --- tests/unit/test_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_bot.py b/tests/unit/test_bot.py index 9d961e6..ef3e0eb 100644 --- a/tests/unit/test_bot.py +++ b/tests/unit/test_bot.py @@ -31,4 +31,4 @@ def test_dispatch_unknown_event(): try: bot.dispatch("non_existent_event") except Exception as e: - pytest.fail(f"Dispatching an unknown event raised an exception: {e}") \ No newline at end of file + pytest.fail(f"Dispatching an unknown event raised an exception: {e}")