nixpkgs/pkgs/applications/version-management/nbstripout/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.0 KiB
Nix
Raw Normal View History

2022-11-28 03:23:43 +00:00
{ lib
, python3
, coreutils
, git
, mercurial
}:
2017-05-07 14:54:36 +00:00
2022-11-28 03:23:43 +00:00
python3.pkgs.buildPythonApplication rec {
version = "0.6.1";
2017-05-07 14:54:36 +00:00
pname = "nbstripout";
2022-11-28 03:23:43 +00:00
src = python3.pkgs.fetchPypi {
2019-09-07 11:43:43 +00:00
inherit pname version;
2022-11-28 03:23:43 +00:00
hash = "sha256-kGW83RSIs4bk88CB/8HUj0UTovjYv00NmiggjF2v6dM=";
2017-05-07 14:54:36 +00:00
};
2017-05-17 06:59:26 +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-11-28 03:23:43 +00:00
propagatedBuildInputs = with python3.pkgs; [
ipython
nbformat
];
nativeCheckInputs = [
2022-11-28 03:23:43 +00:00
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
2017-05-07 14:54:36 +00:00
'';
meta = {
description = "Strip output from Jupyter and IPython notebooks";
homepage = "https://github.com/kynan/nbstripout";
2017-05-07 14:54:36 +00:00
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jluttine ];
};
}