about summary refs log tree commit diff
path: root/pkgs/development/python-modules/nbdime/default.nix
blob: 855192fa5ec54ff96636b8ca23a27a18399581d4 (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
{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, hatch-jupyter-builder
, hatchling
, jupyterlab
, nbformat
, colorama
, pygments
, tornado
, requests
, gitpython
, jupyter-server
, jupyter-server-mathjax
, jinja2
, git
, pytest-tornado
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "nbdime";
  version = "4.0.1";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-8adgwLAMG6m0lFwWzpJXfzk/tR0YTzUbdoW6boUCCY4=";
  };

  patches = [
    # this fixes the webserver (nbdiff-web) when jupyter-server >=2.13 is used
    # see https://github.com/jupyter/nbdime/issues/749
    ./749.patch
  ];

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

  propagatedBuildInputs = [
    nbformat
    colorama
    pygments
    tornado
    requests
    gitpython
    jupyter-server
    jupyter-server-mathjax
    jinja2
  ];

  nativeCheckInputs = [
    git
    pytest-tornado
    pytestCheckHook
  ];

  disabledTests = [
    "test_git_diffdriver"
    "test_git_difftool"
    "test_git_mergedriver"
    "test_git_mergetool"
  ];

  preCheck = ''
    export HOME="$TEMP"
    git config --global user.email "janedoe@example.com"
    git config --global user.name "Jane Doe"
  '';

  __darwinAllowLocalNetworking = true;

  pythonImportsCheck = [
    "nbdime"
  ];

  meta = with lib; {
    homepage = "https://github.com/jupyter/nbdime";
    changelog = "https://github.com/jupyter/nbdime/blob/${version}/CHANGELOG.md";
    description = "Tools for diffing and merging of Jupyter notebooks";
    license = licenses.bsd3;
    maintainers = with maintainers; [ tbenst ];
  };
}