From 8ceb7ca458127ddc015392e96788514697b25a42 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 25 Feb 2025 22:15:17 +0700 Subject: [PATCH] python312Packages.ipylab: fix broken 'ipylab._version' import Running hatchling without the version hook prevents this file from being created, which causes an import error on Darwin. The second hook, one that normally compiles javascript is skipped, as our sources already contain it, yet the declared dependency, hatch-jupyter-builder still needs to be provided. --- pkgs/development/python-modules/ipylab/default.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/ipylab/default.nix b/pkgs/development/python-modules/ipylab/default.nix index 90c9b8a0ae1f..a10fa6ff1fff 100644 --- a/pkgs/development/python-modules/ipylab/default.nix +++ b/pkgs/development/python-modules/ipylab/default.nix @@ -3,6 +3,7 @@ buildPythonPackage, fetchPypi, hatchling, + hatch-jupyter-builder, hatch-nodejs-version, ipywidgets, jupyterlab, @@ -13,6 +14,8 @@ buildPythonPackage rec { version = "1.0.0"; pyproject = true; + # This needs to be fetched from Pypi, as we rely on the nodejs build to be skipped, + # which only happens if ipylab/labextension/style.js is present. src = fetchPypi { inherit pname version; hash = "sha256-xPB0Sx+W1sRgW5hqpZ68zWRFG/cclIOgGat6UsVlYXA="; @@ -20,12 +23,11 @@ buildPythonPackage rec { build-system = [ hatchling + hatch-jupyter-builder hatch-nodejs-version jupyterlab ]; - env.HATCH_BUILD_NO_HOOKS = true; - dependencies = [ ipywidgets ]; @@ -41,10 +43,5 @@ buildPythonPackage rec { changelog = "https://github.com/jtpio/ipylab/releases/tag/v${version}"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ flokli ]; - badPlatforms = [ - # Unclear why it breaks on darwin only - # ModuleNotFoundError: No module named 'ipylab._version' - lib.systems.inspect.patterns.isDarwin - ]; }; }