2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, fetchurl
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2023-08-22 20:05:09 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2022-11-21 17:40:18 +00:00
|
|
|
, hatchling
|
2023-08-22 20:05:09 +00:00
|
|
|
, beautifulsoup4
|
|
|
|
, bleach
|
|
|
|
, defusedxml
|
2020-04-24 23:36:52 +00:00
|
|
|
, jinja2
|
2023-01-20 10:41:00 +00:00
|
|
|
, jupyter-core
|
2020-12-07 07:45:13 +00:00
|
|
|
, jupyterlab-pygments
|
2022-05-18 14:49:53 +00:00
|
|
|
, markupsafe
|
|
|
|
, mistune
|
|
|
|
, nbclient
|
2022-11-21 17:40:18 +00:00
|
|
|
, packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
, pandocfilters
|
2022-11-21 17:40:18 +00:00
|
|
|
, pygments
|
2022-04-27 09:35:20 +00:00
|
|
|
, tinycss2
|
2022-11-21 17:40:18 +00:00
|
|
|
, traitlets
|
2023-08-22 20:05:09 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, flaky
|
2024-02-29 20:09:43 +00:00
|
|
|
, ipykernel
|
2023-08-22 20:05:09 +00:00
|
|
|
, ipywidgets
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
let
|
|
|
|
# see https://github.com/jupyter/nbconvert/issues/1896
|
|
|
|
style-css = fetchurl {
|
|
|
|
url = "https://cdn.jupyter.org/notebook/5.4.0/style/style.min.css";
|
|
|
|
hash = "sha256-WGWmCfRDewRkvBIc1We2GQdOVAoFFaO4LyIvdk61HgE=";
|
|
|
|
};
|
|
|
|
in buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "nbconvert";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "7.16.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-gT5lU3ljYkia5XLjm6G/+XhTYZL7UY4QgmsOjK3wPsg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
# Add $out/share/jupyter to the list of paths that are used to search for
|
|
|
|
# various exporter templates
|
|
|
|
patches = [
|
|
|
|
./templates.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteAllInPlace ./nbconvert/exporters/templateexporter.py
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
mkdir -p share/templates/classic/static
|
|
|
|
cp ${style-css} share/templates/classic/static/style.css
|
2021-03-23 19:22:30 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
beautifulsoup4
|
|
|
|
bleach
|
|
|
|
defusedxml
|
|
|
|
jinja2
|
2023-01-20 10:41:00 +00:00
|
|
|
jupyter-core
|
2020-12-07 07:45:13 +00:00
|
|
|
jupyterlab-pygments
|
2022-05-18 14:49:53 +00:00
|
|
|
markupsafe
|
|
|
|
mistune
|
|
|
|
nbclient
|
2022-11-21 17:40:18 +00:00
|
|
|
packaging
|
2022-05-18 14:49:53 +00:00
|
|
|
pandocfilters
|
2022-11-21 17:40:18 +00:00
|
|
|
pygments
|
2022-05-18 14:49:53 +00:00
|
|
|
tinycss2
|
2022-11-21 17:40:18 +00:00
|
|
|
traitlets
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
importlib-metadata
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
preCheck = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
export HOME=$(mktemp -d)
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
flaky
|
2024-02-29 20:09:43 +00:00
|
|
|
ipykernel
|
2022-05-18 14:49:53 +00:00
|
|
|
ipywidgets
|
|
|
|
pytestCheckHook
|
2020-12-07 07:45:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2022-05-18 14:49:53 +00:00
|
|
|
# Attempts network access (Failed to establish a new connection: [Errno -3] Temporary failure in name resolution)
|
2020-12-07 07:45:13 +00:00
|
|
|
"test_export"
|
2022-05-18 14:49:53 +00:00
|
|
|
"test_webpdf_with_chromium"
|
2022-11-21 17:40:18 +00:00
|
|
|
# ModuleNotFoundError: No module named 'nbconvert.tests'
|
|
|
|
"test_convert_full_qualified_name"
|
|
|
|
"test_post_processor"
|
2020-12-07 07:45:13 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Some of the tests use localhost networking.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Converting Jupyter Notebooks";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/jupyter/nbconvert";
|
|
|
|
changelog = "https://github.com/jupyter/nbconvert/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = lib.licenses.bsd3;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = lib.teams.jupyter.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|