1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 flit-core,
6 attrs,
7 jsonschema,
8 nbclient,
9 nbdime,
10 nbformat,
11 pytest,
12 black,
13 coverage,
14 ipykernel,
15 pytest-cov,
16 pytest-regressions,
17 pytestCheckHook,
18}:
19
20buildPythonPackage rec {
21 pname = "pytest-notebook";
22 version = "0.10.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "chrisjsewell";
27 repo = "pytest-notebook";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-LoK0wb7rAbVbgyURCbSfckWvJDef3tPY+7V4YU1IBRU=";
30 };
31
32 nativeBuildInputs = [
33 flit-core
34 ];
35
36 pythonRelaxDeps = [
37 "attrs"
38 "nbclient"
39 ];
40
41 propagatedBuildInputs = [
42 attrs
43 jsonschema
44 nbclient
45 nbdime
46 nbformat
47 ];
48
49 buildInputs = [ pytest ];
50
51 pythonImportsCheck = [ "pytest_notebook" ];
52
53 nativeCheckInputs = [
54 black
55 coverage
56 ipykernel
57 pytest-cov
58 pytest-regressions
59 pytestCheckHook
60 ];
61
62 preCheck = ''
63 export HOME="$TEMP"
64 '';
65
66 disabledTests = [
67 "test_diff_to_string"
68 "test_execute_notebook_with_coverage"
69 "test_regression_coverage"
70 "test_collection"
71 "test_setup_with_skip_meta"
72 "test_run_fail"
73 "test_run_pass_with_meta"
74 ];
75
76 __darwinAllowLocalNetworking = true;
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}