Extension migration issue (from JupyterLab 2.x to 3.x)

I’ve been migrating GitPlus extension to be both JL 2.x & 3.x compatible. Most things are working now except one little issue for windows users.

The jupyter_server_config/jupyterlab_gitplus.json file (this one) is not getting created automatically for windows users. Relevant part in my setup.py are here - jupyterlab-gitplus/setup.py at 087ada0c861d912b5b3eb4f72ac3809c08578877 · ReviewNB/jupyterlab-gitplus · GitHub

If users manually add this file to correct location then the server extension starts working properly else they get 404 on the API calls. Any pointers?

I have a hunch that tis might be be related to this try-except bit:

Also see Installation will not work if assets are not found and jupyter-packaging is not installed · Issue #159 · jupyterlab/extension-cookiecutter-ts · GitHub

1 Like

Thanks @krassowski. Just saw your comment on the GH issue as well. Looks like jupyter_packaging should be not be a run time dependency.

For a fix, shall I mention dev dependency in extra_requires like it’s done here? jupyterlab-git/setup.py at e5ac50c83d3148438b50ddf37f3355a14fab6438 · jupyterlab/jupyterlab-git · GitHub

Or do I need to straight up include the dependency in install_requires so it’s available at runtime?

Sorry, I don’t have a full understanding of python packaging. Appreciate any insights.

Sorry, I am out of my depth on this one, and I would not want to suggest and incorrect solution that could cause problems later on. If no one chimes in soon-ish I would suggest asking on jupyterlab/jupyterlab - Gitter as it seems as a fairly advanced question.

The most widely-supported practice seems to put jupyter-packaging in pyproject.toml#/build-system/requires, as in the cookiecutter. Definitely don’t make it a runtime dependency.

A perusal of the official data_files docs can help clarify some things, and you might find you don’t even need jupyter-packaging.

1 Like