1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 hatchling,
7 babel,
8 importlib-metadata,
9 jinja2,
10 json5,
11 jsonschema,
12 jupyter-server,
13 packaging,
14 requests,
15 openapi-core,
16 pytest-jupyter,
17 pytestCheckHook,
18 requests-mock,
19 ruamel-yaml,
20 strict-rfc3339,
21}:
22
23buildPythonPackage rec {
24 pname = "jupyterlab-server";
25 version = "2.27.3";
26 pyproject = true;
27
28 disabled = pythonOlder "3.8";
29
30 src = fetchPypi {
31 pname = "jupyterlab_server";
32 inherit version;
33 hash = "sha256-6zbKylnnRHGYjwriXHeUVhC4h/d3JVqiH4Bl3vnlHtQ=";
34 };
35
36 postPatch = ''
37 sed -i "/timeout/d" pyproject.toml
38 '';
39
40 build-system = [ hatchling ];
41
42 dependencies = [
43 babel
44 jinja2
45 json5
46 jsonschema
47 jupyter-server
48 packaging
49 requests
50 ]
51 ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
52
53 optional-dependencies = {
54 openapi = [
55 openapi-core
56 ruamel-yaml
57 ];
58 };
59
60 nativeCheckInputs = [
61 pytest-jupyter
62 pytestCheckHook
63 requests-mock
64 strict-rfc3339
65 ]
66 ++ optional-dependencies.openapi;
67
68 preCheck = ''
69 export HOME=$(mktemp -d)
70 '';
71
72 pytestFlags = [
73 "-Wignore::DeprecationWarning"
74 ];
75
76 disabledTestPaths = [
77 # require optional language pack packages for tests
78 "tests/test_translation_api.py"
79 ];
80
81 pythonImportsCheck = [
82 "jupyterlab_server"
83 ];
84
85 __darwinAllowLocalNetworking = true;
86
87 meta = {
88 description = "Set of server components for JupyterLab and JupyterLab like applications";
89 homepage = "https://github.com/jupyterlab/jupyterlab_server";
90 changelog = "https://github.com/jupyterlab/jupyterlab_server/blob/v${version}/CHANGELOG.md";
91 license = lib.licenses.bsd3;
92 teams = [ lib.teams.jupyter ];
93 };
94}