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.1";
26 pyproject = true;
27
28 disabled = pythonOlder "3.8";
29
30 src = fetchPypi {
31 pname = "jupyterlab_server";
32 inherit version;
33 hash = "sha256-CXtaxwm2dscoSsnF43PxGTClYfUs1ahuT8flqcioYx0=";
34 };
35
36 postPatch = ''
37 sed -i "/timeout/d" pyproject.toml
38 '';
39
40 nativeBuildInputs = [ hatchling ];
41
42 propagatedBuildInputs = [
43 babel
44 jinja2
45 json5
46 jsonschema
47 jupyter-server
48 packaging
49 requests
50 ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
51
52 passthru.optional-dependencies = {
53 openapi = [
54 openapi-core
55 ruamel-yaml
56 ];
57 };
58
59 nativeCheckInputs = [
60 pytest-jupyter
61 pytestCheckHook
62 requests-mock
63 strict-rfc3339
64 ] ++ passthru.optional-dependencies.openapi;
65
66 preCheck = ''
67 export HOME=$(mktemp -d)
68 '';
69
70 pytestFlagsArray = [
71 "-W"
72 "ignore::DeprecationWarning"
73 ];
74
75 disabledTestPaths = [
76 # require optional language pack packages for tests
77 "tests/test_translation_api.py"
78 ];
79
80 pythonImportsCheck = [
81 "jupyterlab_server"
82 "jupyterlab_server.pytest_plugin"
83 ];
84
85 __darwinAllowLocalNetworking = true;
86
87 meta = with lib; {
88 description = "A 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 = licenses.bsd3;
92 maintainers = lib.teams.jupyter.members;
93 };
94}