python3Packages.jupyterlab-execute-time:build from github source, fix build system (#519888)

This commit is contained in:
Peder Bergebakken Sundt
2026-05-19 22:06:07 +00:00
committed by GitHub
@@ -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 = {