2019-12-30 07:04:28 +00:00
|
|
|
{lib, python, git, mercurial, coreutils}:
|
2017-05-07 15:54:36 +01:00
|
|
|
|
2019-12-30 07:04:28 +00:00
|
|
|
with python.pkgs;
|
2017-05-07 15:54:36 +01:00
|
|
|
buildPythonApplication rec {
|
2021-08-13 06:45:17 +01:00
|
|
|
version = "0.5.0";
|
2017-05-07 15:54:36 +01:00
|
|
|
pname = "nbstripout";
|
|
|
|
|
|
|
|
# Mercurial should be added as a build input but because it's a Python
|
|
|
|
# application, it would mess up the Python environment. Thus, don't add it
|
|
|
|
# here, instead add it to PATH when running unit tests
|
2019-12-30 07:04:28 +00:00
|
|
|
checkInputs = [ pytest pytest-flake8 git ];
|
2021-07-20 22:07:53 +01:00
|
|
|
nativeBuildInputs = [ pytest-runner ];
|
2017-05-07 15:54:36 +01:00
|
|
|
propagatedBuildInputs = [ ipython nbformat ];
|
|
|
|
|
2019-09-07 12:43:43 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-08-13 06:45:17 +01:00
|
|
|
sha256 = "86ab50136998d62c9fa92478d2eb9ddc4137e51a28568f78fa8f24a6fbb6a7d8";
|
2017-05-07 15:54:36 +01:00
|
|
|
};
|
|
|
|
|
2017-05-17 07:59:26 +01: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"
|
|
|
|
'';
|
|
|
|
|
2017-05-07 15:54:36 +01:00
|
|
|
# ignore flake8 tests for the nix wrapped setup.py
|
|
|
|
checkPhase = ''
|
2018-01-20 12:31:14 +00:00
|
|
|
PATH=$PATH:$out/bin:${mercurial}/bin pytest .
|
2017-05-07 15:54:36 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Strip output from Jupyter and IPython notebooks";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/kynan/nbstripout";
|
2017-05-07 15:54:36 +01:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ jluttine ];
|
|
|
|
};
|
|
|
|
}
|