2021-05-04 03:45:54 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, GitPython
|
2022-02-11 18:02:08 +00:00
|
|
|
, isort
|
2021-10-15 11:33:48 +01:00
|
|
|
, jupyter-client
|
2021-12-04 09:43:26 +00:00
|
|
|
, jupyter-packaging
|
2021-05-04 03:45:54 +01:00
|
|
|
, jupyterlab
|
2020-12-08 02:19:14 +00:00
|
|
|
, markdown-it-py
|
2021-05-04 03:45:54 +01:00
|
|
|
, mdit-py-plugins
|
2018-12-20 11:18:30 +00:00
|
|
|
, nbformat
|
2021-05-04 03:45:54 +01:00
|
|
|
, notebook
|
|
|
|
, pytestCheckHook
|
2021-12-04 09:43:26 +00:00
|
|
|
, pythonOlder
|
2019-08-03 01:35:05 +01:00
|
|
|
, pyyaml
|
2020-11-05 23:37:49 +00:00
|
|
|
, toml
|
2018-12-20 11:18:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jupytext";
|
2022-01-14 00:58:29 +00:00
|
|
|
version = "1.13.6";
|
2021-05-04 03:45:54 +01:00
|
|
|
format = "pyproject";
|
2018-12-20 11:18:30 +00:00
|
|
|
|
2021-05-04 03:45:54 +01:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-12-08 02:19:14 +00:00
|
|
|
|
2021-05-04 03:45:54 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mwouts";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-14 00:58:29 +00:00
|
|
|
sha256 = "0xvc4i3wwycaqx16qylglywa14ky7mikdv1jm3p7yz19cq5hr0fx";
|
2018-12-20 11:18:30 +00:00
|
|
|
};
|
|
|
|
|
2021-12-04 09:43:26 +00:00
|
|
|
buildInputs = [
|
|
|
|
jupyter-packaging
|
|
|
|
jupyterlab
|
|
|
|
];
|
|
|
|
|
2018-12-20 11:18:30 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-12-08 02:19:14 +00:00
|
|
|
markdown-it-py
|
2021-05-04 03:45:54 +01:00
|
|
|
mdit-py-plugins
|
2018-12-20 11:18:30 +00:00
|
|
|
nbformat
|
2020-12-08 02:19:14 +00:00
|
|
|
pyyaml
|
2020-11-05 23:37:49 +00:00
|
|
|
toml
|
2020-12-08 02:19:14 +00:00
|
|
|
];
|
2019-08-03 01:35:05 +01:00
|
|
|
|
2018-12-20 11:18:30 +00:00
|
|
|
checkInputs = [
|
2021-05-04 03:45:54 +01:00
|
|
|
GitPython
|
2022-02-11 18:02:08 +00:00
|
|
|
isort
|
2021-10-15 11:33:48 +01:00
|
|
|
jupyter-client
|
2021-05-04 03:45:54 +01:00
|
|
|
notebook
|
2021-12-04 09:43:26 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/mwouts/jupytext/pull/885
|
|
|
|
substituteInPlace setup.py \
|
2021-12-05 09:18:59 +00:00
|
|
|
--replace "markdown-it-py~=1.0" "markdown-it-py>=1.0.0,<3.0.0"
|
2021-12-04 09:43:26 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Tests that use a Jupyter notebook require $HOME to be writable
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# Pre-commit tests expect the source directory to be a Git repository
|
|
|
|
"--ignore-glob='tests/test_pre_commit_*.py'"
|
|
|
|
];
|
|
|
|
|
2022-02-11 18:02:08 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_apply_black_through_jupytext" # we can't do anything about ill-formatted notebooks
|
|
|
|
];
|
|
|
|
|
2021-12-04 09:43:26 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"jupytext"
|
|
|
|
"jupytext.cli"
|
2018-12-20 11:18:30 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts";
|
2020-03-03 09:05:42 +00:00
|
|
|
homepage = "https://github.com/mwouts/jupytext";
|
2018-12-20 11:18:30 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ timokau ];
|
|
|
|
};
|
|
|
|
}
|