1{
2 async-generator,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 ipykernel,
7 ipywidgets,
8 jupyter-client,
9 lib,
10 nbconvert,
11 nbformat,
12 nest-asyncio,
13 pytest-asyncio,
14 pytestCheckHook,
15 pythonOlder,
16 testpath,
17 traitlets,
18 xmltodict,
19}:
20
21let
22 nbclient = buildPythonPackage rec {
23 pname = "nbclient";
24 version = "0.10.0";
25 format = "pyproject";
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "jupyter";
31 repo = pname;
32 rev = "refs/tags/v${version}";
33 hash = "sha256-8OLkpwX4Gpam9VSFUtNS41Ypxe4+2yN3ng6iVY9DSqY=";
34 };
35
36 nativeBuildInputs = [ hatchling ];
37
38 propagatedBuildInputs = [
39 async-generator
40 traitlets
41 nbformat
42 nest-asyncio
43 jupyter-client
44 ];
45
46 # circular dependencies if enabled by default
47 doCheck = false;
48
49 nativeCheckInputs = [
50 ipykernel
51 ipywidgets
52 nbconvert
53 pytest-asyncio
54 pytestCheckHook
55 testpath
56 xmltodict
57 ];
58
59 preCheck = ''
60 export HOME=$(mktemp -d)
61 '';
62
63 passthru.tests = {
64 check = nbclient.overridePythonAttrs (_: {
65 doCheck = true;
66 });
67 };
68
69 meta = with lib; {
70 homepage = "https://github.com/jupyter/nbclient";
71 description = "Client library for executing notebooks";
72 mainProgram = "jupyter-execute";
73 license = licenses.bsd3;
74 maintainers = [ ];
75 };
76 };
77in
78nbclient