2025-07-24 13:55:40 +02:00

99 lines
1.8 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# nativeBuildInputs
nodejs,
yarn-berry_3,
distutils,
# build-system
hatch-jupyter-builder,
hatchling,
jupyterlab,
# dependencies
jupyter-server,
jupyterlab-server,
notebook-shim,
tornado,
# tests
pytest-jupyter,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "notebook";
version = "7.4.3";
pyproject = true;
src = fetchFromGitHub {
owner = "jupyter";
repo = "notebook";
tag = "v${version}";
hash = "sha256-DpGWBV5MeCvoGSBadObVEaYwA5kRmHj8NdVWpJ+pHjA=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "timeout = 300" ""
'';
nativeBuildInputs = [
nodejs
yarn-berry_3.yarnBerryConfigHook
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
distutils
];
missingHashes = ./missing-hashes.json;
offlineCache = yarn-berry_3.fetchYarnBerryDeps {
inherit src missingHashes;
hash = "sha256-S0lnRJ+9F1RhymlAOxo3sEJJrHYo5IWeWn80obcgVlM=";
};
build-system = [
hatch-jupyter-builder
hatchling
jupyterlab
];
dependencies = [
jupyter-server
jupyterlab
jupyterlab-server
notebook-shim
tornado
];
nativeCheckInputs = [
pytest-jupyter
pytestCheckHook
];
pytestFlags = [
"-Wignore::DeprecationWarning"
];
env = {
JUPYTER_PLATFORM_DIRS = 1;
};
# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;
meta = {
changelog = "https://github.com/jupyter/notebook/blob/v${version}/CHANGELOG.md";
description = "Web-based notebook environment for interactive computing";
homepage = "https://github.com/jupyter/notebook";
license = lib.licenses.bsd3;
teams = [ lib.teams.jupyter ];
mainProgram = "jupyter-notebook";
};
}