1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6, hatch-jupyter-builder
7, hatchling
8, pandoc
9, pytestCheckHook
10, pytest-console-scripts
11, pytest-jupyter
12, pytest-timeout
13, pytest-tornasync
14, argon2-cffi
15, jinja2
16, tornado
17, pyzmq
18, ipykernel
19, ipython_genutils
20, traitlets
21, jupyter-core
22, jupyter-client
23, jupyter-events
24, jupyter-server-terminals
25, nbformat
26, nbconvert
27, send2trash
28, terminado
29, prometheus-client
30, anyio
31, websocket-client
32, requests
33, requests-unixsocket
34}:
35
36buildPythonPackage rec {
37 pname = "jupyter-server";
38 version = "2.0.6";
39 format = "pyproject";
40 disabled = pythonOlder "3.7";
41
42 src = fetchPypi {
43 pname = "jupyter_server";
44 inherit version;
45 hash= "sha256-jddZkukLfKVWeUoe1cylEmPGl6vG0N9WGvV0qhwKAz8=";
46 };
47
48 nativeBuildInputs = [
49 hatch-jupyter-builder
50 hatchling
51 ];
52
53 propagatedBuildInputs = [
54 argon2-cffi
55 jinja2
56 tornado
57 pyzmq
58 ipython_genutils
59 traitlets
60 jupyter-core
61 jupyter-client
62 jupyter-events
63 jupyter-server-terminals
64 nbformat
65 nbconvert
66 send2trash
67 terminado
68 prometheus-client
69 anyio
70 websocket-client
71 requests-unixsocket
72 ];
73
74 nativeCheckInputs = [
75 ipykernel
76 pandoc
77 pytestCheckHook
78 pytest-console-scripts
79 pytest-jupyter
80 pytest-timeout
81 pytest-tornasync
82 requests
83 ];
84
85 preCheck = ''
86 export HOME=$(mktemp -d)
87 export PATH=$out/bin:$PATH
88 '';
89
90 disabledTests = [
91 "test_cull_idle"
92 ] ++ lib.optionals stdenv.isDarwin [
93 # attempts to use trashcan, build env doesn't allow this
94 "test_delete"
95 # test is presumable broken in sandbox
96 "test_authorized_requests"
97 ];
98
99 disabledTestPaths = [
100 "tests/services/kernels/test_api.py"
101 "tests/services/sessions/test_api.py"
102 # nbconvert failed: `relax_add_props` kwargs of validate has been
103 # deprecated for security reasons, and will be removed soon.
104 "tests/nbconvert/test_handlers.py"
105 ];
106
107 __darwinAllowLocalNetworking = true;
108
109 meta = with lib; {
110 description = "The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications";
111 homepage = "https://github.com/jupyter-server/jupyter_server";
112 license = licenses.bsdOriginal;
113 maintainers = [ maintainers.elohmeier ];
114 };
115}