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