1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchPypi,
6 hatch-jupyter-builder,
7 hatchling,
8 jupyterlab,
9 nbformat,
10 colorama,
11 pygments,
12 tornado,
13 requests,
14 gitpython,
15 jupyter-server,
16 jupyter-server-mathjax,
17 jinja2,
18 git,
19 pytest-tornado,
20 pytestCheckHook,
21}:
22
23buildPythonPackage rec {
24 pname = "nbdime";
25 version = "4.0.1";
26 pyproject = true;
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchPypi {
31 inherit pname version;
32 hash = "sha256-8adgwLAMG6m0lFwWzpJXfzk/tR0YTzUbdoW6boUCCY4=";
33 };
34
35 patches = [
36 # this fixes the webserver (nbdiff-web) when jupyter-server >=2.13 is used
37 # see https://github.com/jupyter/nbdime/issues/749
38 ./749.patch
39 ];
40
41 nativeBuildInputs = [
42 hatch-jupyter-builder
43 hatchling
44 jupyterlab
45 ];
46
47 propagatedBuildInputs = [
48 nbformat
49 colorama
50 pygments
51 tornado
52 requests
53 gitpython
54 jupyter-server
55 jupyter-server-mathjax
56 jinja2
57 ];
58
59 nativeCheckInputs = [
60 git
61 pytest-tornado
62 pytestCheckHook
63 ];
64
65 disabledTests = [
66 "test_git_diffdriver"
67 "test_git_difftool"
68 "test_git_mergedriver"
69 "test_git_mergetool"
70 ];
71
72 preCheck = ''
73 export HOME="$TEMP"
74 git config --global user.email "janedoe@example.com"
75 git config --global user.name "Jane Doe"
76 '';
77
78 __darwinAllowLocalNetworking = true;
79
80 pythonImportsCheck = [ "nbdime" ];
81
82 meta = with lib; {
83 homepage = "https://github.com/jupyter/nbdime";
84 changelog = "https://github.com/jupyter/nbdime/blob/${version}/CHANGELOG.md";
85 description = "Tools for diffing and merging of Jupyter notebooks";
86 license = licenses.bsd3;
87 maintainers = with maintainers; [ tbenst ];
88 };
89}