From 8527eb4cce1ae4f1a6a40e45eb3ad299e7cfb95b Mon Sep 17 00:00:00 2001 From: Gerhard Schwanzer Date: Wed, 29 Jul 2026 22:48:41 +0200 Subject: [PATCH] python3Packages.jupyterlab-git-core: init at 0.54.0 Package the Core distribution introduced by upstream's workspace split. It provides the shared backend and frontend required by jupyterlab-git. https://redirect.github.com/jupyterlab/jupyterlab-git/pull/1453 Assisted-by: pi coding agent / Mika (OpenAI gpt-5.6-sol) --- .../jupyterlab-git-core/default.nix | 96 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 98 insertions(+) create mode 100644 pkgs/development/python-modules/jupyterlab-git-core/default.nix diff --git a/pkgs/development/python-modules/jupyterlab-git-core/default.nix b/pkgs/development/python-modules/jupyterlab-git-core/default.nix new file mode 100644 index 000000000000..087b6e42e175 --- /dev/null +++ b/pkgs/development/python-modules/jupyterlab-git-core/default.nix @@ -0,0 +1,96 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + git, + nodejs, + writableTmpDirAsHomeHook, + yarn-berry_3, + anyio, + hatch-jupyter-builder, + hatch-nodejs-version, + hatchling, + jupyterlab, + nbdime, + nbformat, + packaging, + pexpect, + pytest-asyncio, + pytestCheckHook, + traitlets, +}: + +buildPythonPackage rec { + pname = "jupyterlab-git-core"; + version = "0.54.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jupyterlab"; + repo = "jupyterlab-git"; + tag = "v${version}"; + hash = "sha256-oTXvugfBay2cmRDu4yo6eFm3qGal3wgxc83dFeKs5Gw="; + }; + + nativeBuildInputs = [ + nodejs + yarn-berry_3.yarnBerryConfigHook + ]; + + offlineCache = yarn-berry_3.fetchYarnBerryDeps { + inherit src; + hash = "sha256-gJvrR/4Ov9jHjhPtlqYe9ZfMYOd2WtGQdbDGv/JikJA="; + }; + + preBuild = '' + cd packages/core + ''; + + build-system = [ + hatch-jupyter-builder + hatch-nodejs-version + hatchling + jupyterlab + ]; + + dependencies = [ + anyio + nbformat + packaging + pexpect + traitlets + ]; + + propagatedBuildInputs = [ git ]; + + nativeCheckInputs = [ + nbdime + pytest-asyncio + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + preCheck = '' + ( + cd ../.. + jlpm test --runInBand \ + src/__tests__/test-components/NotebookDiff.spec.tsx \ + src/__tests__/test-components/PlainTextDiff.spec.tsx + ) + + # Upstream's Core tests import the sibling server package from the workspace. + export PYTHONPATH="$PWD/../jupyterlab''${PYTHONPATH:+:$PYTHONPATH}" + ''; + + pytestFlags = [ "--confcutdir=." ]; + + pythonImportsCheck = [ "jupyterlab_git_core" ]; + + meta = { + description = "Core package for the JupyterLab Git extension"; + homepage = "https://github.com/jupyterlab/jupyterlab-git"; + changelog = "https://github.com/jupyterlab/jupyterlab-git/blob/${src.tag}/CHANGELOG.md"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ chiroptical ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5752ba8a10eb..95105648db49 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8666,6 +8666,8 @@ self: super: with self; { jupyterlab-git = callPackage ../development/python-modules/jupyterlab-git { }; + jupyterlab-git-core = callPackage ../development/python-modules/jupyterlab-git-core { }; + jupyterlab-lsp = callPackage ../development/python-modules/jupyterlab-lsp { }; jupyterlab-pygments = callPackage ../development/python-modules/jupyterlab-pygments { };