Browse Source

Backport PR #11770: Fix integrity failure on CI (#11779)

Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
MeeseeksMachine 3 years ago
parent
commit
bcef71e5d5
4 changed files with 6 additions and 4 deletions
  1. 2 1
      buildutils/src/utils.ts
  2. 1 1
      jupyterlab/__init__.py
  3. 1 1
      jupyterlab/pytest_plugin.py
  4. 2 1
      jupyterlab/serverextension.py

+ 2 - 1
buildutils/src/utils.ts

@@ -186,7 +186,8 @@ export function checkStatus(cmd: string): number | null {
  */
 export function getPythonVersion(): string {
   const cmd = 'python setup.py --version';
-  return run(cmd, { stdio: 'pipe' }, true);
+  const lines = run(cmd, { stdio: 'pipe' }, true).split('\n');
+  return lines[lines.length - 1];
 }
 
 /**

+ 1 - 1
jupyterlab/__init__.py

@@ -4,7 +4,6 @@
 # Distributed under the terms of the Modified BSD License.
 
 from ._version import __version__
-from .labapp import LabApp
 from .serverextension import load_jupyter_server_extension
 
 
@@ -17,6 +16,7 @@ def _jupyter_server_extension_paths():
 
 
 def _jupyter_server_extension_points():
+    from .labapp import LabApp
     return [
         {
             'module': 'jupyterlab',

+ 1 - 1
jupyterlab/pytest_plugin.py

@@ -6,7 +6,7 @@ from jupyterlab_server import LabConfig
 from tornado.escape import url_escape
 from traitlets import Unicode
 
-from jupyterlab import LabApp
+from jupyterlab.labapp import LabApp
 
 
 def mkdir(tmp_path, *parts):

+ 2 - 1
jupyterlab/serverextension.py

@@ -1,9 +1,10 @@
-from .labapp import LabApp
 from tornado.web import RedirectHandler
 from jupyter_server.utils import url_path_join
 
 
 def load_jupyter_server_extension(serverapp):
+    from .labapp import LabApp
+
     """Temporary server extension shim when using
     old notebook server.
     """