From ae4f8781ef2559f095d9f16c21e94da5e322758c Mon Sep 17 00:00:00 2001 From: Junlin Zhou Date: Mon, 5 Aug 2024 12:22:57 +0800 Subject: [PATCH 1/2] fix: astart local kernel --- src/pybox/local.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pybox/local.py b/src/pybox/local.py index 6934498..3639597 100644 --- a/src/pybox/local.py +++ b/src/pybox/local.py @@ -5,6 +5,8 @@ from typing import TYPE_CHECKING from uuid import uuid4 +from jupyter_client.asynchronous import AsyncKernelClient + from pybox.base import BasePyBox, BasePyBoxManager from pybox.schema import ( CodeExecutionError, @@ -20,7 +22,6 @@ from jupyter_client.multikernelmanager import DuplicateKernelError if TYPE_CHECKING: - from jupyter_client.asynchronous import AsyncKernelClient from jupyter_client.blocking import BlockingKernelClient except ImportError: logger.warning( @@ -236,7 +237,9 @@ async def astart( # it's OK if the kernel already exists kid = kernel_id km = self.kernel_manager.get_kernel(kernel_id=kid) - return LocalPyBox(kernel_id=kid, client=km.client()) + kernel_client = AsyncKernelClient() + kernel_client.load_connection_info(km.get_connection_info()) + return LocalPyBox(kernel_id=kid, client=kernel_client) def shutdown( self, From 07fa49a90e7cf8309e05df444a6dcfe2283b9260 Mon Sep 17 00:00:00 2001 From: Junlin Zhou Date: Mon, 5 Aug 2024 12:23:19 +0800 Subject: [PATCH 2/2] bump version --- src/pybox/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybox/__about__.py b/src/pybox/__about__.py index 11900ab..fea0a4b 100644 --- a/src/pybox/__about__.py +++ b/src/pybox/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2024-present Junlin Zhou # # SPDX-License-Identifier: Apache-2.0 -__version__ = "0.0.8" +__version__ = "0.0.9"