2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
hatch-jupyter-builder,
|
|
|
|
hatchling,
|
|
|
|
jupyter-client,
|
|
|
|
markdown-it-py,
|
|
|
|
mdit-py-plugins,
|
|
|
|
nbformat,
|
|
|
|
notebook,
|
|
|
|
packaging,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
tomli,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jupytext";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.16.2";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-hifdm+y769ecxKTtRyfYnXjmBrS0ZOq3I1ezsCkCOhQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
2024-01-02 11:29:13 +00:00
|
|
|
hatch-jupyter-builder
|
|
|
|
hatchling
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2020-12-09 12:39:15 +00:00
|
|
|
markdown-it-py
|
2021-05-20 23:08:51 +00:00
|
|
|
mdit-py-plugins
|
2020-04-24 23:36:52 +00:00
|
|
|
nbformat
|
2024-01-02 11:29:13 +00:00
|
|
|
packaging
|
2020-12-09 12:39:15 +00:00
|
|
|
pyyaml
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-10-28 06:52:43 +00:00
|
|
|
jupyter-client
|
2021-05-20 23:08:51 +00:00
|
|
|
notebook
|
2024-01-02 11:29:13 +00:00
|
|
|
pytest-xdist
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Tests that use a Jupyter notebook require $HOME to be writable
|
|
|
|
export HOME=$(mktemp -d);
|
2024-01-02 11:29:13 +00:00
|
|
|
export PATH=$out/bin:$PATH;
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTestPaths = [ "tests/external" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
2022-07-18 16:21:45 +00:00
|
|
|
# requires access to trash
|
|
|
|
"test_load_save_rename"
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"jupytext"
|
|
|
|
"jupytext.cli"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts";
|
|
|
|
homepage = "https://github.com/mwouts/jupytext";
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/mwouts/jupytext/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-08-10 07:59:29 +00:00
|
|
|
maintainers = teams.jupyter.members;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "jupytext";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|