cmd-ntrf / jupyter-lmod

Jupyter plugin that provides a tab for TACC Lmod (https://github.com/TACC/Lmod)
MIT License
28 stars 13 forks source link

status with jupyterlab 4? #65

Open dylex opened 4 months ago

dylex commented 4 months ago

I wanted to try this out and added it to our spack build, but it's failing, maybe because it doesn't support jupyterlab 4, or maybe some other dependency is missing? I presume this is something I'm doing wrong, but just wanted to make sure.

  INFO:hatch_jupyter_builder.utils:> /mnt/sw/nix/store/cc3zrlzd1r55wd1z4la6zkmz3s83b2ys-py-jupyterlab-4.0.13/bin/jlpm run build:prod
  .yarn/cache/@jupyterlab-rendermime-npm-3.6.7-9734a84bd8-038f920296.zip/node_modules/@jupyterlab/rendermime/lib/widgets.d.ts(8,31): error TS2420: Class 'RenderedCommon' incorrectly implements interface 'IRenderer'.
    The types of 'title.owner.layout' are incompatible between these types.
      Type 'import("/dev/shm/nix-build-py-jupyterlmod-4.0.3.drv-3/nixbld1/spack-stage-py-jupyterlmod-4.0.3-ciiqf83w5cb2bxjs63vp4wdx4pd1q5cg/spack-src/labextension/.yarn/cache/@lumino-widgets-npm-1.37.2-89db812cb6-3193f8cca4.zip/node_modules/@lumino/widgets/types/layout").Layout' is not assignable to type 'import("/dev/shm/nix-build-py-jupyterlmod-4.0.3.drv-3/nixbld1/spack-stage-py-jupyterlmod-4.0.3-ciiqf83w5cb2bxjs63vp4wdx4pd1q5cg/spack-src/labextension/.yarn/cache/@lumino-widgets-npm-2.3.2-8f9bc29834-954fe066b0.zip/node_modules/@lumino/widgets/types/layout").Layout'.
        Property '[Symbol.iterator]' is missing in type 'import("/dev/shm/nix-build-py-jupyterlmod-4.0.3.drv-3/nixbld1/spack-stage-py-jupyterlmod-4.0.3-ciiqf83w5cb2bxjs63vp4wdx4pd1q5cg/spack-src/labextension/.yarn/cache/@lumino-widgets-npm-1.37.2-89db812cb6-3193f8cca4.zip/node_modules/@lumino/widgets/types/layout").Layout' but required in type 'import("/dev/shm/nix-build-py-jupyterlmod-4.0.3.drv-3/nixbld1/spack-stage-py-jupyterlmod-4.0.3-ciiqf83w5cb2bxjs63vp4wdx4pd1q5cg/spack-src/labextension/.yarn/cache/@lumino-widgets-npm-2.3.2-8f9bc29834-954fe066b0.zip/node_modules/@lumino/widgets/types/layout").Layout'.
  src/index.ts(7,8): error TS2307: Cannot find module '@jupyterlab/apputils' or its corresponding type declarations.
  src/index.ts(11,8): error TS2307: Cannot find module '@lumino/widgets' or its corresponding type declarations.
  src/index.ts(14,28): error TS2307: Cannot find module '@jupyterlab/coreutils' or its corresponding type declarations.
  src/index.ts(121,10): error TS2339: Property 'id' does not exist on type 'LmodWidget'.
  src/index.ts(122,10): error TS2339: Property 'title' does not exist on type 'LmodWidget'.
  src/index.ts(123,10): error TS2339: Property 'title' does not exist on type 'LmodWidget'.
  src/index.ts(124,10): error TS2339: Property 'addClass' does not exist on type 'LmodWidget'.
  src/index.ts(136,10): error TS2339: Property 'node' does not exist on type 'LmodWidget'.
  src/index.ts(138,10): error TS2339: Property 'node' does not exist on type 'LmodWidget'.
  src/index.ts(174,29): error TS2339: Property 'node' does not exist on type 'LmodWidget'.
  src/index.ts(175,28): error TS2339: Property 'node' does not exist on type 'LmodWidget'.
  src/index.ts(176,29): error TS2339: Property 'node' does not exist on type 'LmodWidget'.
  src/index.ts(181,26): error TS2339: Property 'node' does not exist on type 'LmodWidget'.
  src/index.ts(307,15): error TS2345: Argument of type 'LmodWidget' is not assignable to parameter of type 'Widget'.
    Type 'LmodWidget' is missing the following properties from type 'Widget': dispose, disposed, node, isDisposed, and 47 more.
  src/index.ts(308,17): error TS2345: Argument of type 'LmodWidget' is not assignable to parameter of type 'Widget'.
  src/index.ts(335,18): error TS2339: Property 'node' does not exist on type 'SaveWidget'.
  src/index.ts(362,18): error TS2339: Property 'node' does not exist on type 'RestoreWidget'.
cmd-ntrf commented 4 months ago

Hi! Yes, you are correct, the package does not support jupyterlab 4 for now.

It will try to update it in the coming month and also merge PR #62 and #64. Stay tuned, and thank you for your interest!

lexming commented 4 months ago

I'm also interested in getting support for JupyterLab 4 and JupyterHub 4.1+.

I'm testing JupyterLab 4.2.0 + JupyterHub 4.1.5 and the main issue are the more strict requirements on API calls imposed by JupyterHub. Now all calls to non-static resources must be authenticated. This includes all GET calls to the lmod API as well.

The internal API calls can be fixed with #66. However, there is one more failure related to the external @jupyterlab/server-proxy, which is old and does an unauthenticated call to activate the labextension with server-proxy.

In theory, replacing @jupyterlab/server-proxy with recent versions of @jupyterhub/jupyter-server-proxy (it changed name with version 4.0) should fix the issue. But it is not as simple as a single module change, as then the build fails with several typescript errors. Probably, all dependencies need a version bump.

cmd-ntrf commented 4 months ago

I started some draft work to make it work with JupyterLab 4 in branch jupyterlab4. So far it compiles, I have to figure out if it still works. PR #70