diff --git a/jupyter_server/gateway/managers.py b/jupyter_server/gateway/managers.py index ea4bdbd394..e1fb16908b 100644 --- a/jupyter_server/gateway/managers.py +++ b/jupyter_server/gateway/managers.py @@ -17,12 +17,12 @@ from jupyter_client.manager import AsyncKernelManager from jupyter_client.managerabc import KernelManagerABC from jupyter_server_kernels.kernels.kernelmanager import AsyncMappingKernelManager +from jupyter_server_kernels.sessions.sessionmanager import SessionManager from tornado import web from tornado.escape import json_decode, json_encode, url_escape, utf8 from traitlets import DottedObjectName, Instance, Type, default from .._tz import UTC -from ..services.sessions.sessionmanager import SessionManager from ..utils import ensure_async, url_path_join from .gateway_client import GatewayClient, gateway_request diff --git a/tests/services/kernels/test_api.py b/tests/services/kernels/test_api.py index dfbf1a47bc..3d34b5e47c 100644 --- a/tests/services/kernels/test_api.py +++ b/tests/services/kernels/test_api.py @@ -50,12 +50,12 @@ async def _(kernel_id, ready=None): configs: list = [ { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.MappingKernelManager" + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.MappingKernelManager" } }, { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManager" + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.AsyncMappingKernelManager" } }, ] @@ -68,7 +68,7 @@ async def _(kernel_id, ready=None): # Add a pending kernels condition c = { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManager" + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.AsyncMappingKernelManager" }, "AsyncMappingKernelManager": {"use_pending_kernels": True}, } diff --git a/tests/services/kernels/test_config.py b/tests/services/kernels/test_config.py index 1db2e11b1f..983abc12d4 100644 --- a/tests/services/kernels/test_config.py +++ b/tests/services/kernels/test_config.py @@ -1,8 +1,7 @@ import pytest +from jupyter_server_kernels.kernels.kernelmanager import AsyncMappingKernelManager from traitlets.config import Config -from jupyter_server.services.kernels.kernelmanager import AsyncMappingKernelManager - @pytest.fixture def jp_server_config(): @@ -17,7 +16,7 @@ def test_config(jp_serverapp): def test_async_kernel_manager(jp_configurable_serverapp): argv = [ - "--ServerApp.kernel_manager_class=jupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManager" + "--ServerApp.kernel_manager_class=jupyter_server_kernels.kernels.kernelmanager.AsyncMappingKernelManager" ] app = jp_configurable_serverapp(argv=argv) assert isinstance(app.kernel_manager, AsyncMappingKernelManager) diff --git a/tests/services/kernels/test_connection.py b/tests/services/kernels/test_connection.py index 1022eb3cd4..d3ec54459b 100644 --- a/tests/services/kernels/test_connection.py +++ b/tests/services/kernels/test_connection.py @@ -4,13 +4,13 @@ from jupyter_client.jsonutil import json_clean, json_default from jupyter_client.session import Session +from jupyter_server_kernels.kernels.connection.channels import ( + ZMQChannelsWebsocketConnection, +) from tornado.httpserver import HTTPRequest from tornado.websocket import WebSocketHandler from jupyter_server.serverapp import ServerApp -from jupyter_server.services.kernels.connection.channels import ( - ZMQChannelsWebsocketConnection, -) async def test_websocket_connection(jp_serverapp): diff --git a/tests/services/kernels/test_cull.py b/tests/services/kernels/test_cull.py index 88402a1e04..92655b7395 100644 --- a/tests/services/kernels/test_cull.py +++ b/tests/services/kernels/test_cull.py @@ -31,7 +31,7 @@ def suppress_deprecation_warnings(): Config( { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.MappingKernelManager", + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.MappingKernelManager", "MappingKernelManager": { "cull_idle_timeout": CULL_TIMEOUT, "cull_interval": CULL_INTERVAL, @@ -44,7 +44,7 @@ def suppress_deprecation_warnings(): Config( { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManager", + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.AsyncMappingKernelManager", "AsyncMappingKernelManager": { "cull_idle_timeout": CULL_TIMEOUT, "cull_interval": CULL_INTERVAL, @@ -86,7 +86,7 @@ async def test_cull_idle(jp_fetch, jp_ws_fetch): Config( { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManager", + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.AsyncMappingKernelManager", "AsyncMappingKernelManager": { "cull_idle_timeout": CULL_TIMEOUT, "cull_interval": CULL_INTERVAL, diff --git a/tests/services/sessions/test_api.py b/tests/services/sessions/test_api.py index a307af345b..2ac6eb1a7f 100644 --- a/tests/services/sessions/test_api.py +++ b/tests/services/sessions/test_api.py @@ -10,12 +10,12 @@ import pytest import tornado from jupyter_client.ioloop import AsyncIOLoopKernelManager +from jupyter_server_kernels.kernels.kernelmanager import AsyncMappingKernelManager from nbformat import writes from nbformat.v4 import new_notebook from tornado.httpclient import HTTPClientError from traitlets import default -from jupyter_server.services.kernels.kernelmanager import AsyncMappingKernelManager from jupyter_server.utils import url_path_join from ...utils import expected_http_error @@ -58,12 +58,12 @@ def _default_kernel_manager_class(self): configs: list = [ { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.MappingKernelManager" + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.MappingKernelManager" } }, { "ServerApp": { - "kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManager" + "kernel_manager_class": "jupyter_server_kernels.kernels.kernelmanager.AsyncMappingKernelManager" } }, { diff --git a/tests/services/sessions/test_manager.py b/tests/services/sessions/test_manager.py index 48d5761746..c7746f4f52 100644 --- a/tests/services/sessions/test_manager.py +++ b/tests/services/sessions/test_manager.py @@ -1,18 +1,18 @@ import asyncio import pytest -from tornado import web -from traitlets import TraitError - -from jupyter_server._tz import isoformat, utcnow -from jupyter_server.services.contents.manager import ContentsManager -from jupyter_server.services.kernels.kernelmanager import MappingKernelManager -from jupyter_server.services.sessions.sessionmanager import ( +from jupyter_server_kernels.kernels.kernelmanager import MappingKernelManager +from jupyter_server_kernels.sessions.sessionmanager import ( KernelSessionRecord, KernelSessionRecordConflict, KernelSessionRecordList, SessionManager, ) +from tornado import web +from traitlets import TraitError + +from jupyter_server._tz import isoformat, utcnow +from jupyter_server.services.contents.manager import ContentsManager class DummyKernel: diff --git a/tests/test_serialize.py b/tests/test_serialize.py index 28be8e03b0..bc4f79ad05 100644 --- a/tests/test_serialize.py +++ b/tests/test_serialize.py @@ -2,8 +2,7 @@ import os from jupyter_client.session import Session - -from jupyter_server.services.kernels.connection.base import ( +from jupyter_server_kernels.kernels.connection.base import ( deserialize_binary_message, serialize_binary_message, ) diff --git a/tests/test_serverapp.py b/tests/test_serverapp.py index 5a7a585aef..54fa54203e 100644 --- a/tests/test_serverapp.py +++ b/tests/test_serverapp.py @@ -423,10 +423,8 @@ def test_server_web_application(jp_serverapp): app = ServerWebApplication( server, [], - server.kernel_manager, server.contents_manager, - server.session_manager, - server.kernel_manager, + server.kernel_spec_manager, server.config_manager, server.event_logger, ["jupyter_server.gateway.handlers"],