From 08d3a22e7714c10180ab620eef4626c941936c62 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Nov 2022 11:28:22 -0500 Subject: [PATCH] Revert "continue to allow notebook contents manager" This reverts commit 713b054b4c92caf936e5d0af7f2e5f1bd49d504b. --- jupyter_server/serverapp.py | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/jupyter_server/serverapp.py b/jupyter_server/serverapp.py index b5e728a6d9..865f797b17 100644 --- a/jupyter_server/serverapp.py +++ b/jupyter_server/serverapp.py @@ -6,7 +6,6 @@ import gettext import hashlib import hmac -import inspect import ipaddress import json import logging @@ -133,7 +132,6 @@ MappingKernelManager, ) from jupyter_server.services.sessions.sessionmanager import SessionManager -from jupyter_server.traittypes import TypeFromClasses from jupyter_server.utils import ( check_pid, fetch, @@ -1435,37 +1433,13 @@ def template_file_path(self): help="""If True, display controls to shut down the Jupyter server, such as menu items or buttons.""", ) - # Temporarily allow content managers to inherit from the 'notebook' - # package. We will deprecate this in the next major release. - contents_manager_class = TypeFromClasses( + contents_manager_class = Type( default_value=AsyncLargeFileManager, - klasses=[ - "jupyter_server.services.contents.manager.ContentsManager", - "notebook.services.contents.manager.ContentsManager", - ], + klass=ContentsManager, config=True, help=_i18n("The content manager class to use."), ) - # Throws a deprecation warning to notebook based contents managers. - @observe("contents_manager_class") - def _observe_contents_manager_class(self, change): - new = change["new"] - # If 'new' is a class, get a string representing the import - # module path. - if inspect.isclass(new): - new = new.__module__ - - if new.startswith("notebook"): - self.log.warning( - "The specified 'contents_manager_class' class inherits a manager from the " - "'notebook' package. This is not guaranteed to work in future " - "releases of Jupyter Server. Instead, consider switching the " - "manager to inherit from the 'jupyter_server' managers. " - "Jupyter Server will temporarily allow 'notebook' managers " - "until its next major release (3.x)." - ) - kernel_manager_class = Type( klass=MappingKernelManager, config=True,