1{ lib 2, buildPythonPackage 3, fetchPypi 4, pytestCheckHook 5, glibcLocales 6, entrypoints 7, bleach 8, mistune 9, nbclient 10, jinja2 11, pygments 12, traitlets 13, testpath 14, jupyter_core 15, jupyterlab-pygments 16, nbformat 17, ipykernel 18, pandocfilters 19, tornado 20, jupyter-client 21, defusedxml 22}: 23 24buildPythonPackage rec { 25 pname = "nbconvert"; 26 version = "6.2.0"; 27 28 src = fetchPypi { 29 inherit pname version; 30 sha256 = "16ceecd0afaa8fd26c245fa32e2c52066c02f13aa73387fffafd84750baea863"; 31 }; 32 33 # Add $out/share/jupyter to the list of paths that are used to search for 34 # various exporter templates 35 patches = [ 36 ./templates.patch 37 ]; 38 39 postPatch = '' 40 substituteAllInPlace ./nbconvert/exporters/templateexporter.py 41 ''; 42 43 checkInputs = [ pytestCheckHook glibcLocales ]; 44 45 propagatedBuildInputs = [ 46 entrypoints bleach mistune jinja2 pygments traitlets testpath 47 jupyter_core nbformat ipykernel pandocfilters tornado jupyter-client 48 defusedxml 49 (nbclient.override { doCheck = false; }) # avoid infinite recursion 50 jupyterlab-pygments 51 ]; 52 53 # disable preprocessor tests for ipython 7 54 # see issue https://github.com/jupyter/nbconvert/issues/898 55 preCheck = '' 56 export LC_ALL=en_US.UTF-8 57 HOME=$(mktemp -d) 58 ''; 59 60 pytestFlagsArray = [ 61 "--ignore=nbconvert/preprocessors/tests/test_execute.py" 62 # can't resolve template paths within sandbox 63 "--ignore=nbconvert/tests/base.py" 64 "--ignore=nbconvert/tests/test_nbconvertapp.py" 65 ]; 66 67 68 disabledTests = [ 69 "test_export" 70 "test_webpdf_without_chromium" 71 #"test_cell_tag_output" 72 #"test_convert_from_stdin" 73 #"test_convert_full_qualified_name" 74 ]; 75 76 # Some of the tests use localhost networking. 77 __darwinAllowLocalNetworking = true; 78 79 meta = { 80 description = "Converting Jupyter Notebooks"; 81 homepage = "https://jupyter.org/"; 82 license = lib.licenses.bsd3; 83 maintainers = with lib.maintainers; [ fridh ]; 84 }; 85}