Jupterlab source build - how are the content of directory staging/ got populated?

Could someone shed some light in how jupyterlab/staging/ content are populated?

What I am trying to understanding is the assembly/build process in which the jupyterlab/staging/ are assembled. Which files are input to the build process and what commands are being used.

Is jupyterlab/staging/package.json the right place to start? Or should the process starts at jupyterlab level?

In jupyterlab/staging/, when I run yarn run: $ yarn run build:dev or $yarn run build:prod, the js source codes seem to be pulled from the package, and not from my dev src. Let’s say if I have made some changes to filebrowser-extension, how can I propagate that to staging/ ?

Thanks,

1 Like

It sounds like you are working from a dev install, and are talking about the jupyterlab/staging directory in the git repo - is that right? The staging directory in the repo is populated/updated during the JLab release process. The normal dev workflow (changing a file in the repo, doing jlpm run build, and running jupyter lab --dev-mode) does not touch or use the staging directory.

// It sounds like you are working from a dev install, and are talking about the jupyterlab/staging directory in the git repo - is that right?
Ans: Yes, that is correct.

// The staging directory in the repo is populated/updated during the JLab release process. The normal dev workflow (changing a file in the repo, doing jlpm run build , and running jupyter lab --dev-mode ) does not touch or use the staging directory.
Ans: Yes, that is what I found out. So I was wondering if there is any way to update those.
Eventually, what I did was a real hack: I just copy the changes from dev dir to staging dir myself. Since I have changed only a few files, that was not too bad. I was able to make a pip .whl from the updated source and then can be installed by pip.

Sorry for not replying earlier. I was able to figure out the workaround and was busy in setting up a CICD pipeline to build the special jupyterlab.

What was interesting was that after pip install my special jupyterlab, the jupyter-lab and jupyter-labextension dud not exist in the bin/. This behavior was different from the usual conda install jupyterlab (both could be found in the same bin/ directory where jupyter can be found).

I actually tried to populate the jupyter-lab (and jupyter-labextesion). Both were short python scripts (that I borrowed from jupyter-lab from conda install):

$ cat /opt/conda/bin/jupyter-lab
#!/opt/conda/bin/python3
import re
import sys
from jupyterlab.labapp import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
}

However, jupyter-lab failed in not able to find jupyterlab.labapp (ModuleNotFound error). Upon troubleshooting, I found that jupyterlab had only a few attributes: not even jupyterlab.version was there. These were what was defined:

$ python
import jupyterlab
dir(jupyterlab)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']

I am not sure why attributes like version is missing, and more importantly, why I cannot run jupyterlab.labapp.main( ). (I actually can see jupyterlab/ in the site-package/ directory).

So in summary, I am able to make a pip .whl of the dev build of jupyterlab, but there is no jupyter-lab, and the jupyterlab module does not have jupyterlab.labapp. (I plan to post this to a new question in this board).

Any comment or help would be greatly appreciated. Thanks very much!

FYI, our release process is largely automated (to build that staging directory to make a package, etc.) The release process is documented at jupyterlab/RELEASE.md at ff1bb771f819d0fdcecc6e5770d453473978625d · jupyterlab/jupyterlab · GitHub, and in particular the step that populates the staging directory is jupyterlab/RELEASE.md at ff1bb771f819d0fdcecc6e5770d453473978625d · jupyterlab/jupyterlab · GitHub

I am confused, how to release it after update the jupyterlab source code? All changes only work when adding --dev-mode parameter.