Browse Source

shim the configs

Eric Charles 5 years ago
parent
commit
5945115261
2 changed files with 9 additions and 14 deletions
  1. 8 13
      jupyterlab/labapp.py
  2. 1 1
      setup.py

+ 8 - 13
jupyterlab/labapp.py

@@ -9,7 +9,6 @@ import os
 import os.path as osp
 from os.path import join as pjoin
 import sys
-import warnings
 
 from jupyter_core.application import JupyterApp, base_aliases
 from jupyter_server.serverapp import aliases, flags
@@ -26,6 +25,7 @@ from .commands import (
 from .coreconfig import CoreConfig
 
 from jupyter_server.extension.application import ExtensionApp
+from nbclassic.shimconfig import shim_configs
 
 build_aliases = dict(base_aliases)
 build_aliases['app-dir'] = 'LabBuildApp.app_dir'
@@ -417,19 +417,14 @@ class LabApp(ExtensionApp):
     template_paths = []
 
     def initialize_settings(self):
-        notebookapp_config = self.settings.get('config').get('NotebookApp', None)
-        if notebookapp_config:
-            confs = list(notebookapp_config.keys())
-            self.log.warn("=========================================================================================")
-            self.log.warn("You are using NotebookApp settings that be deprecated at the next major notebook release.")
-            self.log.warn("Please migrate following settings from NotebookApp to ServerApp: {}".format(confs))
-            self.log.warn("Read more on https://...")
-            self.log.warn("=========================================================================================")
-            warnings.warn(
-                "NotebookApp configuration is deprecated. Migrate them to ServerApp",
-                DeprecationWarning, stacklevel=2,
+        merged_config = shim_configs(
+            notebook_config_name = 'jupyter_notebook', 
+            server_config_name = 'jupyter_nbclassic', 
+            extension_config_name = 'jupyter_lab', 
+            argv = sys.argv
             )
-
+        self.config = merged_config
+        
     def initialize_handlers(self):
         """Load any extensions specified by config.
 

+ 1 - 1
setup.py

@@ -139,8 +139,8 @@ setup_args = dict(
 # TODO Pin to a released jupyterlab_server and jupyter_server once available.
 setup_args['install_requires'] = [
     'notebook>=4.3.1',
-    'nbclassic',
     'tornado!=6.0.0, !=6.0.1, !=6.0.2',
+    'nbclassic @ git+https://github.com/datalayer-contrib/jupyter-notebook-classic/@config-shim',
     'jupyterlab_server @ git+https://github.com/datalayer-contrib/jupyterlab-server/@jupyter_server',
     'jupyter_server @ git+https://github.com/jupyter/jupyter_server/@master',
     'jinja2>=2.10'