1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 pythonOlder,
6 fetchPypi,
7 hatch-jupyter-builder,
8 hatchling,
9 jupyter-server,
10 jupyterlab,
11 jupyterlab-server,
12 notebook-shim,
13 tornado,
14 pytest-jupyter,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "notebook";
20 version = "7.2.0";
21 disabled = pythonOlder "3.8";
22
23 format = "pyproject";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-NKK6SwitXRnskw23SE+3l0aheEvp4aX4IY+a+GVqFB8=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace "timeout = 300" ""
33 '';
34
35 nativeBuildInputs = [
36 hatch-jupyter-builder
37 hatchling
38 jupyterlab
39 ];
40
41 propagatedBuildInputs = [
42 jupyter-server
43 jupyterlab
44 jupyterlab-server
45 notebook-shim
46 tornado
47 ];
48
49 nativeCheckInputs = [
50 pytest-jupyter
51 pytestCheckHook
52 ];
53
54 pytestFlagsArray = [
55 "-W"
56 "ignore::DeprecationWarning"
57 ];
58
59 env = {
60 JUPYTER_PLATFORM_DIRS = 1;
61 };
62
63 # Some of the tests use localhost networking.
64 __darwinAllowLocalNetworking = true;
65
66 meta = {
67 changelog = "https://github.com/jupyter/notebook/blob/v${version}/CHANGELOG.md";
68 description = "Web-based notebook environment for interactive computing";
69 homepage = "https://github.com/jupyter/notebook";
70 license = lib.licenses.bsd3;
71 maintainers = lib.teams.jupyter.members;
72 mainProgram = "jupyter-notebook";
73 };
74}