1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # nativeBuildInputs 8 nodejs, 9 yarn-berry_3, 10 distutils, 11 12 # build-system 13 hatch-jupyter-builder, 14 hatchling, 15 jupyterlab, 16 17 # dependencies 18 jupyter-server, 19 jupyterlab-server, 20 notebook-shim, 21 tornado, 22 23 # tests 24 pytest-jupyter, 25 pytestCheckHook, 26}: 27 28buildPythonPackage rec { 29 pname = "notebook"; 30 version = "7.4.1"; 31 pyproject = true; 32 33 src = fetchFromGitHub { 34 owner = "jupyter"; 35 repo = "notebook"; 36 tag = "v${version}"; 37 hash = "sha256-Xz9EZgYNJjWsN7tcTmwXLwH9VW7GnI0P/oNT0IFpkoE="; 38 }; 39 40 postPatch = '' 41 substituteInPlace pyproject.toml \ 42 --replace-fail "timeout = 300" "" 43 ''; 44 45 nativeBuildInputs = 46 [ 47 nodejs 48 yarn-berry_3.yarnBerryConfigHook 49 ] 50 ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ 51 distutils 52 ]; 53 54 missingHashes = ./missing-hashes.json; 55 56 offlineCache = yarn-berry_3.fetchYarnBerryDeps { 57 inherit src missingHashes; 58 hash = "sha256-IFLAwEFsI/GL26XAfiLDyW1mG72gcN2TH651x8Nbrtw="; 59 }; 60 61 build-system = [ 62 hatch-jupyter-builder 63 hatchling 64 jupyterlab 65 ]; 66 67 dependencies = [ 68 jupyter-server 69 jupyterlab 70 jupyterlab-server 71 notebook-shim 72 tornado 73 ]; 74 75 nativeCheckInputs = [ 76 pytest-jupyter 77 pytestCheckHook 78 ]; 79 80 pytestFlagsArray = [ 81 "-W" 82 "ignore::DeprecationWarning" 83 ]; 84 85 env = { 86 JUPYTER_PLATFORM_DIRS = 1; 87 }; 88 89 # Some of the tests use localhost networking. 90 __darwinAllowLocalNetworking = true; 91 92 meta = { 93 changelog = "https://github.com/jupyter/notebook/blob/v${version}/CHANGELOG.md"; 94 description = "Web-based notebook environment for interactive computing"; 95 homepage = "https://github.com/jupyter/notebook"; 96 license = lib.licenses.bsd3; 97 teams = [ lib.teams.jupyter ]; 98 mainProgram = "jupyter-notebook"; 99 }; 100}