a425ba4985
GitOrigin-RevId: 5b091d4fbe3b7b7493c3b46fe0842e4b30ea24b3
79 lines
1.5 KiB
Nix
79 lines
1.5 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, GitPython
|
|
, jupyter-client
|
|
, jupyter-packaging
|
|
, jupyterlab
|
|
, markdown-it-py
|
|
, mdit-py-plugins
|
|
, nbformat
|
|
, notebook
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, pyyaml
|
|
, toml
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "jupytext";
|
|
version = "1.13.5";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mwouts";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "0rapp2baqml1z3n8k7ijf5461b3p8wgr45y3njz54q75v0jk7v45";
|
|
};
|
|
|
|
buildInputs = [
|
|
jupyter-packaging
|
|
jupyterlab
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
markdown-it-py
|
|
mdit-py-plugins
|
|
nbformat
|
|
pyyaml
|
|
toml
|
|
];
|
|
|
|
checkInputs = [
|
|
GitPython
|
|
jupyter-client
|
|
notebook
|
|
pytestCheckHook
|
|
];
|
|
|
|
postPatch = ''
|
|
# https://github.com/mwouts/jupytext/pull/885
|
|
substituteInPlace setup.py \
|
|
--replace "markdown-it-py~=1.0" "markdown-it-py>=1.0.0,<3.0.0"
|
|
'';
|
|
|
|
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'"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"jupytext"
|
|
"jupytext.cli"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts";
|
|
homepage = "https://github.com/mwouts/jupytext";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ timokau ];
|
|
};
|
|
}
|