nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 ansicolors,
12 click,
13 entrypoints,
14 nbclient,
15 nbformat,
16 pyyaml,
17 requests,
18 tenacity,
19 tqdm,
20 pythonAtLeast,
21 aiohttp,
22
23 # optional-dependencies
24 azure-datalake-store,
25 azure-identity,
26 azure-storage-blob,
27 gcsfs,
28 pygithub,
29 pyarrow,
30 boto3,
31
32 # tests
33 ipykernel,
34 moto,
35 pytest-mock,
36 pytestCheckHook,
37 versionCheckHook,
38 writableTmpDirAsHomeHook,
39}:
40
41buildPythonPackage rec {
42 pname = "papermill";
43 version = "2.6.0";
44 pyproject = true;
45
46 src = fetchFromGitHub {
47 owner = "nteract";
48 repo = "papermill";
49 tag = version;
50 hash = "sha256-NxC5+hRDdMCl/7ZIho5ml4hdENrgO+wzi87GRPeMv8Q=";
51 };
52
53 build-system = [ setuptools ];
54
55 dependencies = [
56 ansicolors
57 click
58 entrypoints
59 nbclient
60 nbformat
61 pyyaml
62 requests
63 tenacity
64 tqdm
65 ]
66 ++ lib.optionals (pythonAtLeast "3.12") [ aiohttp ];
67
68 optional-dependencies = {
69 azure = [
70 azure-datalake-store
71 azure-identity
72 azure-storage-blob
73 ];
74 gcs = [ gcsfs ];
75 github = [ pygithub ];
76 hdfs = [ pyarrow ];
77 s3 = [ boto3 ];
78 };
79
80 nativeCheckInputs = [
81 ipykernel
82 moto
83 pytest-mock
84 pytestCheckHook
85 versionCheckHook
86 writableTmpDirAsHomeHook
87 ]
88 ++ optional-dependencies.azure
89 ++ optional-dependencies.s3
90 ++ optional-dependencies.gcs;
91
92 pythonImportsCheck = [ "papermill" ];
93
94 disabledTests = [
95 # pytest 8 compat
96 "test_read_with_valid_file_extension"
97
98 # azure datalake api compat issue
99 "test_create_adapter"
100 ]
101 ++ lib.optionals stdenv.hostPlatform.isDarwin [
102 # might fail due to the sandbox
103 "test_end2end_autosave_slow_notebook"
104 ];
105
106 disabledTestPaths = [
107 # ImportError: cannot import name 'mock_s3' from 'moto'
108 "papermill/tests/test_s3.py"
109
110 # AssertionError: 'error' != 'display_data'
111 "papermill/tests/test_execute.py::TestBrokenNotebook2::test"
112
113 # AssertionError: '\x1b[31mSystemExit\x1b[39m\x1b[31m:\x1b[39m 1\n' != '\x1b[0;31mSystemExit\x1b[0m\x1b[0;31m:\x1b[0m 1\n'
114 "papermill/tests/test_execute.py::TestOutputFormatting::test_output_formatting"
115 ];
116
117 __darwinAllowLocalNetworking = true;
118
119 meta = {
120 description = "Parametrize and run Jupyter and interact with notebooks";
121 homepage = "https://github.com/nteract/papermill";
122 changelog = "https://papermill.readthedocs.io/en/latest/changelog.html";
123 license = lib.licenses.bsd3;
124 maintainers = [ ];
125 mainProgram = "papermill";
126 };
127}