1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 flit-core,
6 pythonRelaxDepsHook,
7 attrs,
8 jsonschema,
9 nbclient,
10 nbdime,
11 nbformat,
12 pytest,
13 black,
14 coverage,
15 ipykernel,
16 pytest-cov,
17 pytest-regressions,
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "pytest-notebook";
23 version = "0.10.0";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "chrisjsewell";
28 repo = "pytest-notebook";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-LoK0wb7rAbVbgyURCbSfckWvJDef3tPY+7V4YU1IBRU=";
31 };
32
33 nativeBuildInputs = [
34 flit-core
35 pythonRelaxDepsHook
36 ];
37
38 pythonRelaxDeps = [
39 "attrs"
40 "nbclient"
41 ];
42
43 propagatedBuildInputs = [
44 attrs
45 jsonschema
46 nbclient
47 nbdime
48 nbformat
49 ];
50
51 buildInputs = [ pytest ];
52
53 pythonImportsCheck = [ "pytest_notebook" ];
54
55 nativeCheckInputs = [
56 black
57 coverage
58 ipykernel
59 pytest-cov
60 pytest-regressions
61 pytestCheckHook
62 ];
63
64 preCheck = ''
65 export HOME="$TEMP"
66 '';
67
68 disabledTests = [
69 "test_diff_to_string"
70 "test_execute_notebook_with_coverage"
71 "test_regression_coverage"
72 "test_collection"
73 "test_setup_with_skip_meta"
74 "test_run_fail"
75 "test_run_pass_with_meta"
76 ];
77
78 meta = {
79 changelog = "https://github.com/chrisjsewell/pytest-notebook/blob/${src.rev}/docs/source/changelog.md";
80 description = "Pytest plugin for regression testing and regenerating Jupyter Notebooks";
81 homepage = "https://github.com/chrisjsewell/pytest-notebook";
82 license = lib.licenses.bsd3;
83 maintainers = with lib.maintainers; [ dotlambda ];
84 };
85}