285.4. jupyterlab-4.6.4
JupyterLab and Jupyter Notebook — computational notebooks served locally to the web browser
| Version | 4.6.4, release 1 |
| Shelf | editors — Text editors, IDEs, notebooks and REPLs |
| Phase | 44_apps (Applications), 79 of 422 in build order |
| Licence | BSD-3-Clause |
| Homepage | https://jupyter.org/ |
| Build time | 3.0 SBU |
| Installed size | 98.2 MiB in 3787 files |
| Recipe | ports/core/editors/jupyterlab/kpkgbuild |
About
JupyterLab and the Jupyter Notebook are computational notebooks: a local server, started with jupyter-lab or jupyter-notebook, runs code cells through a kernel such as python3-ipykernel and serves the documents to the web browser. The port installs both front ends and the server packages they share, from one vendor bundle.
Sources
jupyterlab-4.6.4.tar.gz(27.0 MiB)
sha256404f49b081819378524886c9db66dba57a5565981eff885830df1baba3a17df5
upstream: https://files.pythonhosted.org/packages/source/j/jupyterlab/jupyterlab-4.6.4.tar.gz
archive copy: sources-2/editors--jupyterlab-4.6.4.tar.gzjupyterlab-vendor-4.6.4.tar.xz(23.1 MiB)
sha256ac2f032e60001f93ddf36a71b1660ca07fed68b1d56c8d9339cb0f9ed5718a93
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-2/editors--jupyterlab-vendor-4.6.4.tar.xz
Dependencies
Depends on: python3, python3-pip, python3-setuptools, python3-setuptools-scm, python3-hatchling, python3-hatch-vcs, python3-hatch-jupyter-builder, python3-hatch-nodejs-version, python3-flit-core, python3-poetry-core, python3-scikit-build-core, python3-calver, python3-trove-classifiers, python3-ipykernel, python3-jupyter-core, python3-jupyter-client, python3-nbconvert, python3-tornado, python3-pyzmq, python3-rpds-py, python3-attrs, python3-idna, python3-certifi, python3-cffi, python3-jinja2, python3-markupsafe, python3-packaging, python3-psutil, python3-yaml, python3-requests, python3-dateutil, python3-six, python3-typing-extensions, python3-pygments, python3-lark, python3-send2trash, ipython, argon2, librsvg.
Required by: no port names it.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install jupyterlab'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/editors/jupyterlab.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/editors/jupyterlab
echo '404f49b081819378524886c9db66dba57a5565981eff885830df1baba3a17df5 jupyterlab-4.6.4.tar.gz' | sha256sum -c -
echo 'ac2f032e60001f93ddf36a71b1660ca07fed68b1d56c8d9339cb0f9ed5718a93 jupyterlab-vendor-4.6.4.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/jupyterlab
SRC=$SRC_ROOT/jupyterlab-4.6.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf jupyterlab-4.6.4.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers pyrequirements, pyruntime and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
mkdir -p vendor
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C vendor
_back="$SRC_ROOT/backends"
pip3 install --no-deps --no-index --find-links=vendor --no-build-isolation \
--target "$_back" \
hatch-fancy-pypi-readme pdm-backend
export PYTHONPATH="$_back${PYTHONPATH:+:$PYTHONPATH}"
export HATCH_JUPYTER_BUILDER_SKIP_NPM=1
export ARGON2_CFFI_USE_SYSTEM=1
pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --no-build-isolation \
--root=$PKG --prefix=/usr \
anyio argon2-cffi argon2-cffi-bindings arrow async-lru babel fqdn h11 \
httpcore httpx isoduration json5 jsonpointer jupyter-builder \
jupyter-events jupyter-lsp jupyter-server jupyter-server-terminals \
jupyterlab-server notebook notebook-shim prometheus-client \
python-json-logger rfc3339-validator rfc3986-validator rfc3987-syntax \
terminado uri-template webcolors websocket-client .
test -e "$PKG"/usr/share/jupyter/lab/static/package.json
test -x "$PKG"/usr/bin/jupyter-lab
test -x "$PKG"/usr/bin/jupyter-notebook
install -d "$PKG/etc"
mv "$PKG/usr/etc/jupyter" "$PKG/etc/jupyter"
rmdir "$PKG/usr/etc"
install -Dm644 /dev/stdin \
"$PKG/etc/jupyter/jupyter_server_config.d/kdos-offline.json" <<'JSON'
{
"LabApp": {
"extension_manager": "readonly",
"news_url": null,
"check_for_updates_class": "jupyterlab.NeverCheckForUpdate"
}
}
JSON
for s in 48 64 128 256; do
install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
for i in jupyterlab notebook; do
rsvg-convert -w $s -h $s \
"$PKG/usr/share/icons/hicolor/scalable/apps/$i.svg" \
-o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/$i.png"
done
done
cat > "$PKG/usr/share/applications/jupyter-notebook.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Jupyter Notebook
GenericName=Computational Notebook
Comment=Run the classic Jupyter Notebook interface in the web browser
Exec=jupyter-notebook
Icon=notebook
Terminal=true
Categories=Development;Education;Science;
Keywords=python;notebook;ipynb;jupyter;
DESKTOP
chmod 644 "$PKG/usr/share/applications/jupyter-notebook.desktop"
test -e "$PKG/usr/share/applications/jupyterlab.desktop"
The switches, and why each is set:
HATCH_JUPYTER_BUILDER_SKIP_NPM=1— Keep everyhatch-jupyter-builderbuild hook from running npm. The release archives carry their web front ends already built (jupyterlab/static,notebook/static,jupyter_server/static), and the build has no network. A hook’sensured-targetsare still checked, so a missing built file fails the build.ARGON2_CFFI_USE_SYSTEM=1— Buildargon2-cffi-bindingsagainst the argon2 port instead of compiling the copy of libargon2 in its source.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/jupyterlab, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf jupyterlab-4.6.4-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/jupyterlab, and runs the triggers its paths call for.
Contents
Installed programs: httpx, jlpm, jsonpointer, jupyter-builder, jupyter-events, jupyter-lab, jupyter-labextension, jupyter-labhub, jupyter-notebook, jupyter-server, pybabel, pyjson5, wsdump.
Installed directories: /etc/jupyter, /usr/lib/python3.14/site-packages/_argon2_cffi_bindings, /usr/lib/python3.14/site-packages/anyio, /usr/lib/python3.14/site-packages/anyio-4.15.1.dist-info, /usr/lib/python3.14/site-packages/argon2, /usr/lib/python3.14/site-packages/argon2_cffi-25.1.0.dist-info, /usr/lib/python3.14/site-packages/argon2_cffi_bindings-26.1.0.dist-info, /usr/lib/python3.14/site-packages/arrow, /usr/lib/python3.14/site-packages/arrow-1.4.0.dist-info, /usr/lib/python3.14/site-packages/async_lru, /usr/lib/python3.14/site-packages/async_lru-2.3.0.dist-info, /usr/lib/python3.14/site-packages/babel, /usr/lib/python3.14/site-packages/babel-2.18.0.dist-info, /usr/lib/python3.14/site-packages/fqdn, /usr/lib/python3.14/site-packages/fqdn-1.5.1.dist-info, /usr/lib/python3.14/site-packages/h11, /usr/lib/python3.14/site-packages/h11-0.16.0.dist-info, /usr/lib/python3.14/site-packages/httpcore, /usr/lib/python3.14/site-packages/httpcore-1.0.9.dist-info, /usr/lib/python3.14/site-packages/httpx, /usr/lib/python3.14/site-packages/httpx-0.28.1.dist-info, /usr/lib/python3.14/site-packages/isoduration, /usr/lib/python3.14/site-packages/isoduration-20.11.0.dist-info, /usr/lib/python3.14/site-packages/json5, /usr/lib/python3.14/site-packages/json5-0.15.0.dist-info, /usr/lib/python3.14/site-packages/jsonpointer-3.1.1.dist-info, /usr/lib/python3.14/site-packages/jupyter_builder, /usr/lib/python3.14/site-packages/jupyter_builder-1.2.3.dist-info, /usr/lib/python3.14/site-packages/jupyter_events, /usr/lib/python3.14/site-packages/jupyter_events-0.12.1.dist-info, /usr/lib/python3.14/site-packages/jupyter_lsp, /usr/lib/python3.14/site-packages/jupyter_lsp-2.3.1.dist-info, /usr/lib/python3.14/site-packages/jupyter_server, /usr/lib/python3.14/site-packages/jupyter_server-2.21.1.dist-info, /usr/lib/python3.14/site-packages/jupyter_server_terminals, /usr/lib/python3.14/site-packages/jupyter_server_terminals-0.5.4.dist-info, /usr/lib/python3.14/site-packages/jupyterlab, /usr/lib/python3.14/site-packages/jupyterlab-4.6.4.dist-info, /usr/lib/python3.14/site-packages/jupyterlab_server, /usr/lib/python3.14/site-packages/jupyterlab_server-2.28.1.dist-info, /usr/lib/python3.14/site-packages/notebook, /usr/lib/python3.14/site-packages/notebook-7.6.3.dist-info, /usr/lib/python3.14/site-packages/notebook_shim, /usr/lib/python3.14/site-packages/notebook_shim-0.2.4.dist-info, /usr/lib/python3.14/site-packages/prometheus_client, /usr/lib/python3.14/site-packages/prometheus_client-0.26.0.dist-info, /usr/lib/python3.14/site-packages/python_json_logger-4.2.0.dist-info, /usr/lib/python3.14/site-packages/pythonjsonlogger, /usr/lib/python3.14/site-packages/rfc3339_validator-0.1.4.dist-info, /usr/lib/python3.14/site-packages/rfc3986_validator-0.1.1.dist-info, /usr/lib/python3.14/site-packages/rfc3987_syntax, /usr/lib/python3.14/site-packages/rfc3987_syntax-1.1.0.dist-info, /usr/lib/python3.14/site-packages/terminado, /usr/lib/python3.14/site-packages/terminado-0.18.1.dist-info, /usr/lib/python3.14/site-packages/uri_template, /usr/lib/python3.14/site-packages/uri_template-1.3.0.dist-info, /usr/lib/python3.14/site-packages/webcolors, /usr/lib/python3.14/site-packages/webcolors-25.10.0.dist-info, /usr/lib/python3.14/site-packages/websocket, /usr/lib/python3.14/site-packages/websocket_client-1.9.2.dist-info, /usr/share/jupyter/lab, /usr/share/jupyter/labextensions/@jupyter-notebook, /usr/share/licenses/jupyterlab.
Notes
vendoring = python with an explicit pypackages list: the bundle holds the source distributions of every Python package the two front ends need that is not a port of its own, plus the build requirements of each, and build.sh installs that list --no-deps from it (see The three Python keys). A package listed here is owned by this port, so a module that another program also imports belongs in a python3-* port that both name in depends, never in this bundle.
Two build backends in the bundle, hatch-fancy-pypi-readme and pdm-backend, are not ports. They go into $SRC_ROOT/backends, which is put on PYTHONPATH for this build only, so nothing outside the package is written.
pip writes the server’s configuration under /usr/etc/jupyter, which build.sh moves to /etc/jupyter. Beside it, jupyter_server_config.d/kdos-offline.json sets three defaults that otherwise reach the network: the extension manager is readonly instead of installing from PyPI, news_url is null so no announcements feed is fetched, and the update check is jupyterlab.NeverCheckForUpdate.
Upstream ships both icons only as SVG, which build.sh rasterises to PNG for the panel. Both upstream menu entries start a server in a terminal and open it in the web browser. The Notebook entry is replaced with one that claims no file types, so only JupyterLab opens notebook files.