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 = "5.7.10";
29
30 src = fetchPypi {
31 inherit pname version;
32 sha256 = "b10107e1438e7a564292aa32510e610c88844cae03c882fe5286b891792b5c11";
33 };
34
35 LC_ALL = "en_US.utf8";
36
37 checkInputs = [ nose glibcLocales ]
38 ++ (if isPy3k then [ nose_warnings_filters ] else [ mock ]);
39
40 propagatedBuildInputs = [
41 jinja2 tornado ipython_genutils traitlets jupyter_core send2trash
42 jupyter-client nbformat nbconvert ipykernel terminado requests pexpect
43 prometheus-client
44 ];
45
46 # disable warning_filters
47 preCheck = lib.optionalString (!isPy3k) ''
48 echo "" > setup.cfg
49 '';
50
51 postPatch = ''
52 # Remove selenium tests
53 rm -rf notebook/tests/selenium
54
55 '';
56
57 checkPhase = ''
58 runHook preCheck
59 mkdir tmp
60 HOME=tmp nosetests -v ${if (stdenv.isDarwin) then ''
61 --exclude test_delete \
62 --exclude test_checkpoints_follow_file
63 ''
64 else ""}
65 '';
66
67 # Some of the tests use localhost networking.
68 __darwinAllowLocalNetworking = true;
69
70 meta = {
71 description = "The Jupyter HTML notebook is a web-based notebook environment for interactive computing";
72 homepage = "https://jupyter.org/";
73 license = lib.licenses.bsd3;
74 maintainers = with lib.maintainers; [ ];
75 };
76}