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