Browse Source

fix handling of labextensions_path

Steven Silvester 4 years ago
parent
commit
739fbd44b2
2 changed files with 12 additions and 12 deletions
  1. 11 11
      jupyterlab/labextensions.py
  2. 1 1
      setup.py

+ 11 - 11
jupyterlab/labextensions.py

@@ -14,7 +14,8 @@ from copy import copy
 
 from jupyter_core.application import JupyterApp, base_flags, base_aliases
 from jupyter_core.paths import jupyter_path
-
+from jupyterlab.coreconfig import CoreConfig
+from jupyterlab.debuglog import DebugLogFileMixin
 from traitlets import Bool, Instance, Unicode
 
 from .commands import (
@@ -23,10 +24,8 @@ from .commands import (
     link_package, unlink_package, build, get_app_version, HERE,
     update_extension, AppOptions,
 )
-from jupyterlab.coreconfig import CoreConfig
-from jupyterlab.debuglog import DebugLogFileMixin
-
 from .dynamic_labextensions import develop_labextension_py, build_labextension, watch_labextension
+from .labapp import LabApp
 
 
 flags = dict(base_flags)
@@ -209,9 +208,10 @@ class WatchLabExtensionApp(BaseExtensionApp):
 
     def run_task(self):
         self.extra_args = self.extra_args or [os.getcwd()]
-        # TODO: get the config for labextensions paths from LabApp
-        from jupyter_core.paths import jupyter_path
-        labextensions_path = jupyter_path('labextensions')
+        # Get the labextensions path config from the LabApp
+        lab = LabApp()
+        lab.load_config_file()
+        labextensions_path = lab.extra_labextensions_path + lab.labextensions_path
         watch_labextension(self.extra_args[0], labextensions_path, logger=self.log, development=self.development)
 
 
@@ -301,10 +301,10 @@ class ListLabExtensionsApp(BaseExtensionApp):
     description = "List the installed labextensions"
 
     def run_task(self):
-        # TODO: get the config for labextensions paths from LabApp
-        import pdb; pdb.set_trace()
-        from jupyter_core.paths import jupyter_path
-        labextensions_path = jupyter_path('labextensions')
+        # Get the labextensions path config from the LabApp
+        lab = LabApp()
+        lab.load_config_file()
+        labextensions_path = lab.extra_labextensions_path + lab.labextensions_path
         list_extensions(app_options=AppOptions(
             app_dir=self.app_dir, logger=self.log, core_config=self.core_config, labextensions_path=labextensions_path))
 

+ 1 - 1
setup.py

@@ -151,7 +151,7 @@ setup_args = dict(
 setup_args['install_requires'] = [
     'ipython',
     'tornado!=6.0.0, !=6.0.1, !=6.0.2',
-    'jupyterlab_server~=2.0.0b5',
+    'jupyterlab_server~=2.0.0b7',
     'jupyter_server~=1.0.0rc13',
     'nbclassic~=0.2.0rc4',
     'jinja2>=2.10'