Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension migration for JupyterLab 2.x #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

axelfahy
Copy link

@axelfahy axelfahy commented Mar 6, 2020

Modifications have been done according to the migration guide:
https://jupyterlab.readthedocs.io/en/stable/developer/extension_migration.html

  • Update dependencies

  • Change @phosphor/* to @lumino/*

  • Change ReadonlyJSONObject to ReadonlyPartialJSONObject

  • Session is now accessible from NotebookPanel.sessionContext
    instead of NotebookPanel.session

  • Change required version in README

This should close #113

Please finish the following when submitting a pull request:

  • Add a line to History.md briefly documenting the change.

If this is a release, additionally do the following:

  • Bump the package version in package.json
  • Update the dependencies in package.json
  • Run jlpm install to update yarn.lock

Thanks!

Modification have been done according to the migration guide:
<https://jupyterlab.readthedocs.io/en/stable/developer/extension_migration.html>

- Update dependencies

- Change @phosphor/* to @lumino/*

- Change ``ReadonlyJSONObject`` to ``ReadonlyPartialJSONObject``

- Session is now accessible from ``NotebookPanel.sessionContext``
  instead of ``NotebookPanel.session``

- Change required version in README
@walkerqt
Copy link

walkerqt commented Mar 7, 2020

Already used your code. Thanks!

@axelfahy
Copy link
Author

axelfahy commented Mar 7, 2020

Your welcome, while this or another solution gets merged, I have published the npm package as @axlair/jupyterlab_vim as a temporary solution.

@zaneselvans
Copy link

Thanks so much for making these updates! I've just installed the extension you published to temporarily replace jupyterlab_vim but for some reason it doesn't seem to be taking effect. I've rebuilt Jupyter both via the web interface and at the command line and it still gives me the default keybindings, even though your extension is shown as installed and working, in both the web and command line interface. E.g.

$ jupyter labextension list
JupyterLab v2.0.1
Known labextensions:
   app dir: /home/zane/miniconda3/envs/pudl-dev/share/jupyter/lab
        @axlair/jupyterlab_vim v0.12.1  enabled  OK
        nbdime-jupyterlab v1.0.0 disabled  X

   The following extension are outdated:
        nbdime-jupyterlab

Seems odd. Is there anything else that needs to be done to make the extension active?

@axelfahy
Copy link
Author

axelfahy commented Mar 9, 2020

I don't think there is anything else to do to activate the extension. Maybe one of your browser's extension is conflicting with the plugin. I am using Firefox and I don't have any issue, however on Chromium, if I have the plugin Vimum activated on the page, the jupyterlab_vim plugin is not working.

@kevlubkcm
Copy link

@zaneselvans I had a similar issue. resolved it by clearing out my virtual env entirely and rebuilding from scratch

@jmrichardson
Copy link

jmrichardson commented Mar 28, 2020

Hi, I am not too familiar with npm, but i did the following and it doesn't seem to be working:


(jupyterlab) D:\Projects>npm i @axlair/jupyterlab_vim
npm WARN saveError ENOENT: no such file or directory, open 'D:\Projects\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'D:\Projects\package.json'
npm WARN Projects No description
npm WARN Projects No repository field.
npm WARN Projects No README data
npm WARN Projects No license field.

+ @axlair/jupyterlab_vim@0.12.2
updated 1 package and audited 236788 packages in 1.604s

15 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


(jupyterlab) D:\Projects>jupyter labextension list
JupyterLab v2.0.1
Known labextensions:
   app dir: D:\Anaconda3\envs\jupyterlab\share\jupyter\lab
        @jupyter-widgets/jupyterlab-manager v2.0.0 enabled  ok
        @jupyterlab/debugger v0.2.0 enabled  ok
        @jupyterlab/github v2.0.0 enabled  ok
        @jupyterlab/shortcutui v0.5.0-beta.2 enabled  ok
        @jupyterlab/toc v3.0.0 enabled  ok
        @lckr/jupyterlab_variableinspector v0.5.0 enabled  ok
        qgrid2 v1.1.2 enabled  ok

What am I doing wrong? TIA

Solution:

Got it to work. Cloned your repository and did:

jupyter labextension install .

Thanks for this work

@Sh4pe
Copy link

Sh4pe commented Apr 22, 2020

I'm really looking forward to use the vim plugin in Jupyter Lab 2.0. :)

@nmvega
Copy link

nmvega commented Apr 24, 2020

Your welcome, while this or another solution gets merged, I have published the npm package as @axlair/jupyterlab_vim as a temporary solution.

Hello! =:) Thank you for this, firstly.

I'm getting the following exception. Am I applying this incorrectly, or it's correct but my versions are not supported?

root# /opt/tljh/user/bin/jupyter labextension install jupyterlab_vim
An error occured.
ValueError: The extension "jupyterlab_vim" does not yet support the current
version of JupyterLab.


Conflicting Dependencies:
JupyterLab              Extension      Package
>=2.1.0 <2.2.0          >=1.0.1 <2.0.0 @jupyterlab/application
>=2.1.0 <2.2.0          >=1.0.1 <2.0.0 @jupyterlab/notebook
See the log file for details:  /root/.temp.d/jupyterlab-debug-esw3phkv.log

Thank you!

@axelfahy
Copy link
Author

What is your jupyterlab version? Have you tried in a new environment with a fresh installation of jupyterlab?

@nmvega
Copy link

nmvega commented Apr 24, 2020

@axelfahy Hi. Yes its a fresh install of TLJH, as of last night (EDT). In fact, I always build it as code from a Dockerfile for build consistency and quality, which includes steps for pip(1) updating packages in both the HUB and USER virtual environments of TLJH. So JupyterLabs version is v2.1.x. I have to check the actual version because, ironically, v2.1.1 was released 7-hours ago and I'm unsure if I rebuilt it slightly before that was released. But it's v2.1.x, for sure.

@TheGhostHuCodes
Copy link

Hi @nmvega,

Did you execute this command to install @axelfahy 's build?
jupyter labextension install @axlair/jupyterlab_vim

I think executing:
jupyter labextension install jupyterlab_vim
will install the current master build of the jupyterlab_vim labextension, which does not support JupyterLab 2.X until this PR is merged.

@nmvega
Copy link

nmvega commented Apr 24, 2020

@TheGhostHuCodes Hello! I did not try that variation. I'm unfamiliar with the @ syntax unfortunately (which I guess means pull from the specified npm repository?), but I will try your suggestion in an hour or so and report back. 😊

@nmvega
Copy link

nmvega commented Apr 24, 2020

@TheGhostHuCodes Hello! I did not try that variation. I'm unfamiliar with the @ syntax unfortunately (which I guess means pull from the specified npm repository?), but I will try your suggestion in an hour or so and report back.

@TheGhostHuCodes @axelfahy
Hello! The variation that @TheGhostHuCodes proposed worked, just now. \o/

So for the those visiting here, the complete solution is:

root# /opt/tljh/user/bin/pip install --upgrade jupyterlab  # Upgraded from v2.1.0 to v2.1.1

root# /opt/tljh/user/bin/jupyter labextension install @axlair/jupyterlab_vim
Building jupyterlab assets (build:prod:minimize)
root#

I then reloaded my JupyterLab and Notebook sessions, and now vim(1) key-bindings work.

Notice that I did this under the USER environment of TLJH; however the above will likely work for you in any JupyterLab setting (like running it on your laptop).

@axelfahy Thank for you this solution. I've been using vi(1)/vim(1) since the days when I was stuck in many cold datacenters with only a vt100 terminal and a Sun / Solaris UNIX CLI prompt. I simply can't use arrow keys for navigation anymore. =:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin incompatible with Jupyter Lab 2.0
9 participants