1{ stdenv
2, lib
3, buildPythonPackage
4, fetchPypi
5, nose
6, nose_warnings_filters
7, glibcLocales
8, isPy3k
9, mock
10, jinja2
11, tornado
12, ipython_genutils
13, traitlets
14, jupyter_core
15, jupyter_client
16, nbformat
17, nbconvert
18, ipykernel
19, terminado
20, requests
21, send2trash
22, pexpect
23, prometheus_client
24}:
25
26buildPythonPackage rec {
27 pname = "notebook";
28 version = "6.0.3";
29 disabled = !isPy3k;
30
31 src = fetchPypi {
32 inherit pname version;
33 sha256 = "47a9092975c9e7965ada00b9a20f0cf637d001db60d241d479f53c0be117ad48";
34 };
35
36 LC_ALL = "en_US.utf8";
37
38 checkInputs = [ nose glibcLocales ]
39 ++ (if isPy3k then [ nose_warnings_filters ] else [ mock ]);
40
41 propagatedBuildInputs = [
42 jinja2 tornado ipython_genutils traitlets jupyter_core send2trash
43 jupyter_client nbformat nbconvert ipykernel terminado requests pexpect
44 prometheus_client
45 ];
46
47 # disable warning_filters
48 preCheck = lib.optionalString (!isPy3k) ''
49 echo "" > setup.cfg
50 '';
51
52 postPatch = ''
53 # Remove selenium tests
54 rm -rf notebook/tests/selenium
55
56 '';
57
58 checkPhase = ''
59 runHook preCheck
60 mkdir tmp
61 HOME=tmp nosetests -v ${if (stdenv.isDarwin) then ''
62 --exclude test_delete \
63 --exclude test_checkpoints_follow_file
64 ''
65 else ""}
66 '';
67
68 # Some of the tests use localhost networking.
69 __darwinAllowLocalNetworking = true;
70
71 meta = {
72 description = "The Jupyter HTML notebook is a web-based notebook environment for interactive computing";
73 homepage = https://jupyter.org/;
74 license = lib.licenses.bsd3;
75 maintainers = with lib.maintainers; [ fridh ];
76 };
77}