about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/jupyterlab-git/default.nix
blob: 512c7994745789724b4136d5f186e4a8da07cd2d (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
{ lib
, buildPythonPackage
, fetchPypi
, git
, jupyter-server
, hatch-jupyter-builder
, hatch-nodejs-version
, hatchling
, jupyterlab
, nbdime
, nbformat
, pexpect
, pytest-asyncio
, pytest-jupyter
, pytest-tornasync
, pytestCheckHook
, pythonOlder
, traitlets
}:

buildPythonPackage rec {
  pname = "jupyterlab-git";
  version = "0.50.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchPypi {
    pname = "jupyterlab_git";
    inherit version;
    hash = "sha256-CYWVRtOQE067kYqWXCw/4mBf6v4yfPYWFb592Qtb37s=";
  };

  nativeBuildInputs = [
    hatch-jupyter-builder
    hatch-nodejs-version
    hatchling
    jupyterlab
  ];

  propagatedBuildInputs = [
    jupyter-server
    nbdime
    git
    nbformat
    pexpect
    traitlets
  ];

  nativeCheckInputs = [
    jupyterlab
    pytest-asyncio
    pytest-jupyter
    pytest-tornasync
    pytestCheckHook
  ];

  preCheck = ''
    export HOME=$TMPDIR
  '';

  disabledTestPaths = [
    "jupyterlab_git/tests/test_handlers.py"
    # PyPI doesn't ship all required files for the tests
    "jupyterlab_git/tests/test_config.py"
    "jupyterlab_git/tests/test_integrations.py"
    "jupyterlab_git/tests/test_remote.py"
    "jupyterlab_git/tests/test_settings.py"
  ];

  disabledTests = [
    "test_Git_get_nbdiff_file"
    "test_Git_get_nbdiff_dict"
  ];

  pythonImportsCheck = [
    "jupyterlab_git"
  ];

  __darwinAllowLocalNetworking = true;

  meta = with lib; {
    description = "Jupyter lab extension for version control with Git";
    homepage = "https://github.com/jupyterlab/jupyterlab-git";
    changelog = "https://github.com/jupyterlab/jupyterlab-git/blob/v${version}/CHANGELOG.md";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ chiroptical ];
  };
}