Skip to content

Commit

Permalink
Revert "continue to allow notebook contents manager"
Browse files Browse the repository at this point in the history
This reverts commit 713b054.
  • Loading branch information
blink1073 committed Nov 2, 2022
1 parent 713b054 commit 08d3a22
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import gettext
import hashlib
import hmac
import inspect
import ipaddress
import json
import logging
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 08d3a22

Please sign in to comment.