1{ stdenv
2, lib
3, buildPythonPackage
4, pythonOlder
5, fetchPypi
6, argon2-cffi
7, glibcLocales
8, mock
9, jinja2
10, tornado
11, ipython_genutils
12, traitlets
13, jupyter-core
14, jupyter-client
15, nbformat
16, nbclassic
17, nbconvert
18, ipykernel
19, terminado
20, requests
21, send2trash
22, pexpect
23, prometheus-client
24, pytestCheckHook
25}:
26
27buildPythonPackage rec {
28 pname = "notebook";
29 version = "6.5.2";
30 disabled = pythonOlder "3.7";
31
32 src = fetchPypi {
33 inherit pname version;
34 hash = "sha256-wYl+UxfiJfx4tFVJpqtLZo5MmW/QOgTpOP5eevK//9A=";
35 };
36
37 LC_ALL = "en_US.utf8";
38
39 nativeCheckInputs = [ pytestCheckHook glibcLocales ];
40
41 propagatedBuildInputs = [
42 jinja2
43 tornado
44 ipython_genutils
45 traitlets
46 jupyter-core
47 send2trash
48 jupyter-client
49 nbformat
50 nbclassic
51 nbconvert
52 ipykernel
53 terminado
54 requests
55 pexpect
56 prometheus-client
57 argon2-cffi
58 ];
59
60 postPatch = ''
61 # Remove selenium tests
62 rm -rf notebook/tests/selenium
63 export HOME=$TMPDIR
64 '';
65
66 disabledTests = [
67 # a "system_config" is generated, and fails many tests
68 "config"
69 "load_ordered"
70 # requires jupyter, but will cause circular imports
71 "test_run"
72 "TestInstallServerExtension"
73 "launch_socket"
74 "sock_server"
75 "test_list_formats" # tries to find python MIME type
76 "KernelCullingTest" # has a race condition failing on slower hardware
77 "test_connections" # tornado.simple_httpclient.HTTPTimeoutError: Timeout during request"
78 ] ++ lib.optionals stdenv.isDarwin [
79 "test_delete"
80 "test_checkpoints_follow_file"
81 ];
82
83 disabledTestPaths = lib.optionals stdenv.isDarwin [
84 # requires local networking
85 "notebook/auth/tests/test_login.py"
86 "notebook/bundler/tests/test_bundler_api.py"
87 ];
88
89 # Some of the tests use localhost networking.
90 __darwinAllowLocalNetworking = true;
91
92 meta = {
93 description = "The Jupyter HTML notebook is a web-based notebook environment for interactive computing";
94 homepage = "https://jupyter.org/";
95 license = lib.licenses.bsd3;
96 maintainers = with lib.maintainers; [ fridh ];
97 mainProgram = "jupyter-notebook";
98 };
99}