Parcourir la source

Merge pull request #9743 from krassowski/extensions-package-url

Use get_package_url from jupyterlab-server
Steven Silvester il y a 4 ans
Parent
commit
33f9294426
2 fichiers modifiés avec 4 ajouts et 10 suppressions
  1. 2 8
      jupyterlab/commands.py
  2. 2 2
      setup.py

+ 2 - 8
jupyterlab/commands.py

@@ -29,7 +29,7 @@ import warnings
 
 from jupyter_core.paths import jupyter_config_path, jupyter_path
 from jupyterlab_server.process import which, Process, WatchHelper, list2cmdline
-from jupyterlab_server.config import LabConfig, get_page_config, get_federated_extensions, get_static_page_config, write_page_config
+from jupyterlab_server.config import LabConfig, get_page_config, get_federated_extensions, get_package_url, get_static_page_config, write_page_config
 from jupyter_server.extension.serverextension import GREEN_ENABLED, GREEN_OK, RED_DISABLED, RED_X
 from traitlets import HasTraits, Bool, Dict, Instance, List, Unicode, default
 
@@ -1407,13 +1407,7 @@ class _AppHandler(object):
                 alias = filename[len(PIN_PREFIX):-len(".tgz")]
             else:
                 alias = None
-            # homepage, repository  are optional
-            if 'homepage' in data:
-                url = data['homepage']
-            elif 'repository' in data and isinstance(data['repository'], dict):
-                url = data['repository'].get('url', '')
-            else:
-                url = ''
+            url = get_package_url(data)
             extensions[alias or name] = dict(path=path,
                                     filename=osp.basename(path),
                                     url=url,

+ 2 - 2
setup.py

@@ -146,7 +146,7 @@ setup_args['install_requires'] = [
     'packaging',
     'tornado>=6.1.0',
     'jupyter_core',
-    'jupyterlab_server~=2.0',
+    'jupyterlab_server~=2.2',
     'jupyter_server~=1.2',
     'nbclassic~=0.2',
     'jinja2>=2.10'
@@ -159,7 +159,7 @@ setup_args['extras_require'] = {
         'pytest-cov',
         'pytest-console-scripts',
         'pytest-check-links',
-        'jupyterlab_server[test]~=2.0',
+        'jupyterlab_server[test]~=2.2',
         'requests',
         'wheel',
         'virtualenv'