about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/jupyterlab_server/default.nix
blob: 2ec4ccf47e7eb452d6dfc6e4fe487cc14fa5c22b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{ lib
, buildPythonPackage
, fetchPypi
, hatchling
, jsonschema
, pythonOlder
, requests
, pytestCheckHook
, json5
, babel
, jupyter-server
, tomli
, openapi-core
, pytest-jupyter
, requests-mock
, ruamel-yaml
, strict-rfc3339
, importlib-metadata
}:

buildPythonPackage rec {
  pname = "jupyterlab_server";
  version = "2.24.0";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-Tm+Z4KVXm7vDLkScTbsDlWHU8aeCfVczJz7VZzjyHwc=";
  };

  nativeBuildInputs = [
    hatchling
  ];

  propagatedBuildInputs = [
    requests
    jsonschema
    json5
    babel
    jupyter-server
    tomli
  ] ++ lib.optionals (pythonOlder "3.10") [
    importlib-metadata
  ];

  nativeCheckInputs = [
    openapi-core
    pytestCheckHook
    pytest-jupyter
    requests-mock
    ruamel-yaml
    strict-rfc3339
  ];

  postPatch = ''
    sed -i "/timeout/d" pyproject.toml
  '';

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  pytestFlagsArray = [
    # DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12.
    # Use setuptools or check PEP 632 for potential alternatives.
    "-W ignore::DeprecationWarning"
  ];

  disabledTestPaths = [
    "tests/test_settings_api.py"
    "tests/test_themes_api.py"
    "tests/test_translation_api.py"
    "tests/test_workspaces_api.py"
  ];

  disabledTests = [
    "test_get_listing"
  ];

  __darwinAllowLocalNetworking = true;

  meta = with lib; {
    description = "A set of server components for JupyterLab and JupyterLab like applications";
    homepage = "https://jupyterlab-server.readthedocs.io/";
    changelog = "https://github.com/jupyterlab/jupyterlab_server/blob/v${version}/CHANGELOG.md";
    license = licenses.bsdOriginal;
    maintainers = lib.teams.jupyter.members;
  };
}