2022-07-14 12:49:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchpatch
|
2022-07-14 12:49:19 +00:00
|
|
|
, flit-core
|
|
|
|
, importlib-metadata
|
|
|
|
, ipython
|
|
|
|
, jupyter-cache
|
|
|
|
, nbclient
|
|
|
|
, myst-parser
|
|
|
|
, nbformat
|
|
|
|
, pyyaml
|
|
|
|
, sphinx
|
|
|
|
, sphinx-togglebutton
|
|
|
|
, typing-extensions
|
|
|
|
, ipykernel
|
2023-03-27 19:17:25 +00:00
|
|
|
, pythonRelaxDepsHook
|
2022-07-14 12:49:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "myst-nb";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "0.17.2";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-D2E4ZRX6sHxzZGrcqX//L2n0HpDTE6JgIXxbvkGdhYs=";
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
patches = [
|
|
|
|
# Fix compatiblity with myst-parser 1.0. Remove with the next release.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/executablebooks/MyST-NB/commit/48c45c6a8c4501005766c2d821b5e9ddfbedd5fa.patch";
|
|
|
|
hash = "sha256-jGL2MjZArvPtbiaR/rRGCIi0QwYO0iTIK26GLuTrBM8=";
|
|
|
|
excludes = [
|
|
|
|
"myst_nb/__init__.py"
|
|
|
|
"docs/authoring/custom-formats.Rmd"
|
|
|
|
"docs/authoring/jupyter-notebooks.md"
|
|
|
|
"docs/index.md"
|
|
|
|
"pyproject.toml"
|
|
|
|
"tests/nb_fixtures/reporter_warnings.txt"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "myst-parser~=0.18.0" "myst-parser"
|
|
|
|
'';
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
importlib-metadata
|
|
|
|
ipython
|
|
|
|
jupyter-cache
|
|
|
|
nbclient
|
|
|
|
myst-parser
|
|
|
|
nbformat
|
|
|
|
pyyaml
|
|
|
|
sphinx
|
|
|
|
sphinx-togglebutton
|
|
|
|
typing-extensions
|
|
|
|
ipykernel
|
|
|
|
];
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"myst-parser"
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"myst_nb"
|
|
|
|
"myst_nb.sphinx_ext"
|
|
|
|
];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Jupyter Notebook Sphinx reader built on top of the MyST markdown parser";
|
2023-04-29 16:46:19 +00:00
|
|
|
homepage = "https://github.com/executablebooks/MyST-NB";
|
2022-10-06 18:32:54 +00:00
|
|
|
changelog = "https://github.com/executablebooks/MyST-NB/raw/v${version}/CHANGELOG.md";
|
2022-07-14 12:49:19 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ marsam ];
|
|
|
|
};
|
|
|
|
}
|