2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, coreutils
|
|
|
|
, git
|
|
|
|
, mercurial
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
version = "0.6.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "nbstripout";
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
src = python3.pkgs.fetchPypi {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit pname version;
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-kGW83RSIs4bk88CB/8HUj0UTovjYv00NmiggjF2v6dM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# for some reason, darwin uses /bin/sh echo native instead of echo binary, so
|
|
|
|
# force using the echo binary
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/test-git.t --replace "echo" "${coreutils}/bin/echo"
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
ipython
|
|
|
|
nbformat
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
coreutils
|
|
|
|
git
|
|
|
|
mercurial
|
|
|
|
] ++ (with python3.pkgs; [
|
|
|
|
pytest-cram
|
|
|
|
pytestCheckHook
|
|
|
|
]);
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
git config --global init.defaultBranch main
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Strip output from Jupyter and IPython notebooks";
|
|
|
|
homepage = "https://github.com/kynan/nbstripout";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ jluttine ];
|
|
|
|
};
|
|
|
|
}
|