From 0a13d5f329e344369f03d2b0cb8b0c9b283ac43b Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Wed, 13 May 2026 11:58:38 -0700 Subject: [PATCH] python3Packages.jupyterlab-execute-time: build from github source --- .../jupyterlab-execute-time/default.nix | 49 +++++++++++++++---- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/jupyterlab-execute-time/default.nix b/pkgs/development/python-modules/jupyterlab-execute-time/default.nix index 0f2bcac650b1..208cc7dad923 100644 --- a/pkgs/development/python-modules/jupyterlab-execute-time/default.nix +++ b/pkgs/development/python-modules/jupyterlab-execute-time/default.nix @@ -1,8 +1,19 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + + # build-system + hatchling, + hatch-jupyter-builder, + + # build inputs jupyterlab, + nodejs, + writableTmpDirAsHomeHook, + yarn-berry_3, + + # dependencies jupyter-packaging, }: @@ -11,26 +22,44 @@ buildPythonPackage rec { version = "3.3.0"; pyproject = true; - src = fetchPypi { - pname = "jupyterlab_execute_time"; - inherit version; - hash = "sha256-kA/Rrrv9PZQ9NiXu+XPu1VW7J0XUmEBAJ4OVnIod/Do="; + src = fetchFromGitHub { + owner = "deshaw"; + repo = "jupyterlab-execute-time"; + rev = "v${version}"; + hash = "sha256-1eNv6yTyorg64PXQm68eqp56Ig0eUbhPWluI/s4oijE="; }; - # jupyterlab is required to build from source but we use the pre-build package + # Fix version requirements and replace jupyterlab's pinned yarn (jlpm) with yarn postPatch = '' substituteInPlace pyproject.toml \ - --replace-fail '"jupyterlab~=4.0.0"' "" + --replace-fail "jupyterlab~=4.0.0" "jupyterlab" + substituteInPlace pyproject.toml package.json \ + --replace-fail 'jlpm' 'yarn' ''; + build-system = [ + hatchling + hatch-jupyter-builder + ]; + + nativeBuildInputs = [ + jupyterlab + nodejs + writableTmpDirAsHomeHook + yarn-berry_3 + yarn-berry_3.yarnBerryConfigHook + ]; + + offlineCache = yarn-berry_3.fetchYarnBerryDeps { + yarnLock = "${src}/yarn.lock"; + hash = "sha256-aCuw+4FqA0JPMr++AgE4WI+KmXda1IosaU2yk/vE7vw="; + }; + dependencies = [ jupyterlab jupyter-packaging ]; - # has no tests - doCheck = false; - pythonImportsCheck = [ "jupyterlab_execute_time" ]; meta = {