diff --git a/pkgs/applications/version-management/nbstripout/default.nix b/pkgs/applications/version-management/nbstripout/default.nix index ca8224a5aa62..4978722e6382 100644 --- a/pkgs/applications/version-management/nbstripout/default.nix +++ b/pkgs/applications/version-management/nbstripout/default.nix @@ -2,6 +2,7 @@ lib, python3, fetchPypi, + fetchFromGitHub, coreutils, gitMinimal, mercurial, @@ -16,11 +17,12 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-6qyLa05yno3+Hl3ywPi6RKvFoXplRI8EgBQfgL4jC7E="; }; - # 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" - ''; + testAssets = fetchFromGitHub { + owner = "kynan"; + repo = "nbstripout"; + rev = "${version}"; + hash = "sha256-OSJLrWkYQIhcdyofS3Bo39ppsU6K3A4546UKB8Q1GGg="; + }; propagatedBuildInputs = with python3.pkgs; [ nbformat @@ -33,14 +35,21 @@ python3.pkgs.buildPythonApplication rec { mercurial ] ++ (with python3.pkgs; [ - pytest-cram pytestCheckHook ]); + checkInputs = [ + testAssets + ]; + preCheck = '' export HOME=$(mktemp -d) export PATH=$out/bin:$PATH git config --global init.defaultBranch main + + cp -r --no-preserve=mode,ownership ${testAssets}/tests/e2e_notebooks $TMPDIR/e2e_notebooks + chmod -R +w $TMPDIR/e2e_notebooks + substituteInPlace tests/test_end_to_end.py --replace "tests/e2e_notebooks" "$TMPDIR/e2e_notebooks" ''; meta = {