How do updates and upgrades work for an extension?

Hi everyone,

I’ve developed and released an extension for JupyterLab, and I was wondering if there were any best practices for managing updates and upgrades.

  1. Is there a mechanism that allows notifying a user when a newer version of the extension is available?
  2. Can the Extension Manager install a newer version of the extension directly, or does the user need to uninstall the existing extension and install it again to get the latest? My tests were not conclusive.

Thank you in advance,

Thibaut

1 Like

There should be an “Update” button shown in the extension manager. But there is no notification right now, you may wish to open an feature request issue on JupyterLab repo.

  • Can the Extension Manager install a newer version of the extension directly, or does the user need to uninstall the existing extension and install it again to get the latest? My tests were not conclusive.

Yes, it can; if it does not work, please open a detailed bug report with all the infromation needed to reproduce (Issues · jupyterlab/jupyterlab · GitHub).

2 Likes

Hi @krassowski,

Following up on this one. I’ve tested again today with the following setup:

I just bumped my extension version. However I couldn’t see the update button.

Now, I’m thinking the issue comes from the fact that I have an extension with multiple sub-extensions (Github). This means, each individual extension is not published on PyPi, hence the extension manager can’t find new version to upgrade to.

So now I’m wondering what would be the best approach. I liked to be able to have modular sub-extensions, but it doesn’t seem to fit with how the extension manager has been designed. Is my only solution to refactor my extension as a single extension? I’m new to this, so any pointers would be helpful.

Thanks in advance

1 Like

You can have multiple python packages and one top-level package that depends on all the others.

2 Likes

This is what Elyra (GitHub - elyra-ai/elyra: Elyra extends JupyterLab with an AI centric approach.) does.

1 Like

Thanks @krassowski for your responses, I came back to it and tried to look at Elyra. It looks like to me Elyra has the same behavior:

The different sub-extensions are also displayed separately and we don’t have the ability to upgrade the whole Elyra package easily.

Am I doing something wrong? :s

The different sub-extensions are also displayed separately and we don’t have the ability to upgrade the whole Elyra package easily.

Well, if your top-level package specifies version pins with >= then updating it should also update all the sub-packages, right?

1 Like

Yes, if you update the main package (top-level package), all the sub-packages are updated. Actually it works fine installing and upgrading it manually with pip, no problem there.

What I was looking for is the “update button” you mentioned above, that I can’t seem to be able to find due to the sub-packages.

1 Like

Do you have install.json file included in the sub-packages?

1 Like

I am not sure if this is currently used for the update button (my guess is that it is not), but I think it could be used to enable it in your scenario with not much effort (one PR).

1 Like

I actually don’t use an install.json. I’ll try to add one and see if it helps, I’ll let you know. Thank you for the pointer. If it doesn’t help for the update button, maybe it could be a great improvement indeed.

@krassowski As you guessed, adding an install.json to the sub-packages did not enable the update button. You mentioned we may be able to enable it for this scenario, would you have any pointer? I’d be willing to take a look.

Thank you for your responses. Appreciate it!