From e2fee0d48b01f91df3c9e872e6efdb13131750ee Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 10 May 2025 15:26:34 +0900 Subject: [PATCH 1/2] python3Packages.jupyterlab-git: refactor --- .../python-modules/jupyterlab-git/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/jupyterlab-git/default.nix b/pkgs/development/python-modules/jupyterlab-git/default.nix index eced578e768b..a2f392c30210 100644 --- a/pkgs/development/python-modules/jupyterlab-git/default.nix +++ b/pkgs/development/python-modules/jupyterlab-git/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchPypi, git, + writableTmpDirAsHomeHook, jupyter-server, hatch-jupyter-builder, hatch-nodejs-version, @@ -10,12 +11,12 @@ jupyterlab, nbdime, nbformat, + packaging, pexpect, pytest-asyncio, pytest-jupyter, pytest-tornasync, pytestCheckHook, - pythonOlder, traitlets, }: @@ -24,7 +25,6 @@ buildPythonPackage rec { version = "0.51.1"; pyproject = true; - disabled = pythonOlder "3.8"; src = fetchPypi { pname = "jupyterlab_git"; @@ -32,34 +32,33 @@ buildPythonPackage rec { hash = "sha256-t7zol5XVzojIqvDXnrepPQU1Yi+b5rAZyprk07mpymo="; }; - nativeBuildInputs = [ + build-system = [ hatch-jupyter-builder hatch-nodejs-version hatchling jupyterlab ]; - propagatedBuildInputs = [ + dependencies = [ jupyter-server nbdime - git nbformat + packaging pexpect traitlets ]; + propagatedBuildInputs = [ git ]; + nativeCheckInputs = [ jupyterlab pytest-asyncio pytest-jupyter pytest-tornasync pytestCheckHook + writableTmpDirAsHomeHook ]; - preCheck = '' - export HOME=$TMPDIR - ''; - disabledTestPaths = [ "jupyterlab_git/tests/test_handlers.py" # PyPI doesn't ship all required files for the tests From 9a54dd36f14a93d7cdbc3bfb0d63cf51f5eb6869 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 10 May 2025 15:45:15 +0900 Subject: [PATCH 2/2] python3Packages.jupyterlab-git: build from source --- .../python-modules/jupyterlab-git/default.nix | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/jupyterlab-git/default.nix b/pkgs/development/python-modules/jupyterlab-git/default.nix index a2f392c30210..5c31e1bf2133 100644 --- a/pkgs/development/python-modules/jupyterlab-git/default.nix +++ b/pkgs/development/python-modules/jupyterlab-git/default.nix @@ -1,9 +1,12 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, git, + gitMinimal, + nodejs, writableTmpDirAsHomeHook, + yarn-berry_3, jupyter-server, hatch-jupyter-builder, hatch-nodejs-version, @@ -25,11 +28,21 @@ buildPythonPackage rec { version = "0.51.1"; pyproject = true; + src = fetchFromGitHub { + owner = "jupyterlab"; + repo = "jupyterlab-git"; + tag = "v${version}"; + hash = "sha256-gAE8Qx+R97D5DCsgXgb1XtnRcdIkKWxe+J+Sk4OnYJM="; + }; - src = fetchPypi { - pname = "jupyterlab_git"; - inherit version; - hash = "sha256-t7zol5XVzojIqvDXnrepPQU1Yi+b5rAZyprk07mpymo="; + nativeBuildInputs = [ + nodejs + yarn-berry_3.yarnBerryConfigHook + ]; + + offlineCache = yarn-berry_3.fetchYarnBerryDeps { + inherit src; + hash = "sha256-r52Hj1Z2CpgH2AjeyGNuRO/WPWfdaY/e1d37jGJacBc="; }; build-system = [ @@ -51,7 +64,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ git ]; nativeCheckInputs = [ - jupyterlab + gitMinimal pytest-asyncio pytest-jupyter pytest-tornasync @@ -61,11 +74,6 @@ buildPythonPackage rec { disabledTestPaths = [ "jupyterlab_git/tests/test_handlers.py" - # PyPI doesn't ship all required files for the tests - "jupyterlab_git/tests/test_config.py" - "jupyterlab_git/tests/test_integrations.py" - "jupyterlab_git/tests/test_remote.py" - "jupyterlab_git/tests/test_settings.py" ]; disabledTests = [