jupyterlab-contrib / jupyterlab-vim

Vim notebook cell bindings for JupyterLab
https://jupyterlab-contrib.github.io/jupyterlab-vim.html
MIT License
691 stars 43 forks source link

Update for jupyterlab3 - switch to pip install (federated) #19

Closed ianhi closed 3 years ago

ianhi commented 3 years ago

Updates for jlab3. I took the opportunity to switch this over to the new style "federated" extensions that eliminate the need for a build step. A consequence of this is that a pypi package will need to be released and that the method for loading the vim keymap switched from importing it to calling the ensureVimKeymap function (more details in commit message).

I also applied the recommended tsconfig, eslint, and prettier settings from the upgrade script and then linted in a separate commit.

Closes: https://github.com/axelfahy/jupyterlab-vim/issues/14

Installing now If anyone is realllllllly wanting this extension for jlab3 prior this being merged then you're in luck @axelfahy has uploaded this PR to pypi and you can install like so

pip install jupyterlab-vim

If this is a release, additionally do the following:

ianhi commented 3 years ago

CI fails but I can confirm that the extension works.

ianhi commented 3 years ago

But I think we should wait until the release of the final jupyterlab3 version to merge in order to keep compatibility with jupyterlab2 until the stable release of jupyterlab3.

Totally agree, but I knew how to do this and to avoid the gotcha of not knowing about ensureVimKeymap so I just wanted to make this public sooner rather than later.

Once we decide on the package name, I will publish this to pypi.

Two things here if it ends up with a name like jupyterlab-vim:

  1. @jwkvam should have an input (or ability to say "please don't")
  2. Given that this is a pretty general name would you be open to giving a few other people write access/pypi access so the project is robust against any one person no longer being involved. (i.e. safegaurd against the jlab2 switch nightmare)?
    • Though if jlab-vim makes it's way into core in 3.1 this would be less of an issue.
axelfahy commented 3 years ago
2\. Given that this is a pretty general name would you be open to giving a few other people write access/pypi access so the project is robust against any one person no longer being involved. (i.e. safegaurd against the jlab2 switch nightmare)?

Sure, I can set multiple maintainers for the pip repository.

* Though if jlab-vim makes it's way into core in 3.1 this would be less of an issue.

That would be the best solution IMHO, I hope it will be in core in the 3.1 version.

Two things here if it ends up with a name like jupyterlab-vim:

1. @jwkvam should have an input (or ability to say "please don't")

So let's stick with jupyterlab_vim?

ianhi commented 3 years ago

I wonder what was so bad about nodejs 13? weird.

ianhi commented 3 years ago

Looking at this more carefully: the build.yml workflow actually does everything that the pull-request action does already so maybe just delete the old pull-request script and rename the build one?

ianhi commented 3 years ago

Also, we can set up automated releases to pypi - though the version I know how to use requires you to bump the version manually then you create a release using the github interface. Thoughts on disabling the automated version bumper and switching to script that publishes to both pypi and npm?

axelfahy commented 3 years ago

Also, we can set up automated releases to pypi - though the version I know how to use requires you to bump the version manually then you create a release using the github interface. Thoughts on disabling the automated version bumper and switching to script that publishes to both pypi and npm?

For Python, I know versioneer, that uses the tag of the commit. But we can bump it manually, there will probably not be many versions.

ianhi commented 3 years ago

Actually it seems that the single source of truth for versioning is contained in the package.json. _version.py just reads that file to get the version. So The automated version bump should still work, though it will need to be modified to also push to pypi

axelfahy commented 3 years ago

though it will need to be modified to also push to pypi

Yes, definitely. In the meantime, I pushed the package from this branch to pypi (https://pypi.org/project/jupyterlab-vim/). An hyphen was set instead of the underscore on the Pypi page, probably because the main folder has one, even if the package name has undescore (jupyterlab_vim-0.13.0-py3-none-any.whl). I sent you an invite for the pypi project, so you can push new versions as well.

ianhi commented 3 years ago

Yes, definitely. In the meantime, I pushed the package from this branch to pypi (https://pypi.org/project/jupyterlab-vim/)

Nice! I'll edit my first post to reflect this.

I sent you an invite for the pypi project, so you can push new versions as well.

Awesome thanks. Though hopefully I'll never have to make use of that ability.

ianhi commented 3 years ago

Hey @axelfahy heads up that jlab3 has been released now. Is there anything more we need to do here?

axelfahy commented 3 years ago

Hey @axelfahy heads up that jlab3 has been released now. Is there anything more we need to do here?

I don't think so, I will merge. Thank you!