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

Remove the dependency on jupyterlab #1234

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Feb 7, 2025

It looks like the dependency on jupyterlab was first added in #74.

According to this PR and the git history, it seems it was likely more for convenience as installing jupyter-ai only with pip install jupyter-ai would then automatically install jupyterlab.

However it looks like jupyter-ai does not make use of any Python import from jupyterlab when searching the code base: https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai%20jupyterlab&type=code

Except for testing here:

from jupyterlab.galata import configure_jupyter_server

Also generally JupyterLab extensions don't specify the dependency on jupyterlab by default in the extension template, so it's easier to install and reuse extensions in different contexts and environments. And JupyterLab users are already expected to have JupyterLab installed in their environment.

Not having the dependency on jupyterlab will also make it easier to use jupyter-ai with custom lab-based application that are not JupyterLab (but based on jupyterlab_server).

@jtpio jtpio added the maintenance Change related to maintenance of the repository label Feb 7, 2025
@dlqqq
Copy link
Member

dlqqq commented Feb 10, 2025

@jtpio Can you explain in more detail why we follow the convention of having extensions not define a dependency on jupyterlab? Defining this dependency allows a package manager to automatically detect if this extension is not compatible with the user's current version of JupyterLab.

I believe we added this version constraint shortly after JupyterLab 3 was deprecated. That way, when running pip install jupyter_ai:

  • a user on JupyterLab 3 would install Jupyter AI 1.x,
  • and a user on JupyterLab 4 would install Jupyter AI 2.x.

I guess the trade off is that upgrading Jupyter AI via pip install -U jupyter_ai would update the JupyterLab version, possibly bumping the major version. Is this what we're trying to avoid?

@SylvainCorlay
Copy link
Member

The main reason is that these extensions should work in other jupyterlab-based applications (which are remixes of jupyterlab extensions) without pulling JupyterLab.

@dlqqq dlqqq force-pushed the remove-jupyterlab-dependency branch from 5bb0036 to 2c2509f Compare February 10, 2025 19:19
Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks!

@SylvainCorlay SylvainCorlay merged commit 7b4586e into jupyterlab:main Feb 11, 2025
9 checks passed
@jtpio jtpio deleted the remove-jupyterlab-dependency branch February 11, 2025 17:09
@dlqqq
Copy link
Member

dlqqq commented Feb 11, 2025

@meeseeksdev please backport to 2.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Change related to maintenance of the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants