summary refs log tree commit diff
path: root/pkgs/applications/version-management/nbstripout
diff options
context:
space:
mode:
authorJaakko Luttinen <jaakko.luttinen@iki.fi>2018-04-03 10:46:55 +0300
committerJaakko Luttinen <jaakko.luttinen@iki.fi>2018-04-05 10:02:34 +0300
commitcaf87949107dc31aaa23570ea5362c92412bb5cf (patch)
tree1bbf8a85944f1e7d3769e35a7fd1cc948aabc863 /pkgs/applications/version-management/nbstripout
parent56fb68dcef494b7cdb3e09362d67836b8137019c (diff)
downloadnixpkgs-caf87949107dc31aaa23570ea5362c92412bb5cf.tar
nixpkgs-caf87949107dc31aaa23570ea5362c92412bb5cf.tar.gz
nixpkgs-caf87949107dc31aaa23570ea5362c92412bb5cf.tar.bz2
nixpkgs-caf87949107dc31aaa23570ea5362c92412bb5cf.tar.lz
nixpkgs-caf87949107dc31aaa23570ea5362c92412bb5cf.tar.xz
nixpkgs-caf87949107dc31aaa23570ea5362c92412bb5cf.tar.zst
nixpkgs-caf87949107dc31aaa23570ea5362c92412bb5cf.zip
nbstripout: fix tests
Building of nbstripout has failed after the version was bumped to 0.3.1 because:
the test files were missing from the new release tarball. This adds tests by
using the release tarball from GitHub instead of PyPI.

However, these tests fail because of a bug in one test. Thus, a patch is used to
fix the tests.
Diffstat (limited to 'pkgs/applications/version-management/nbstripout')
-rw-r--r--pkgs/applications/version-management/nbstripout/default.nix27
1 files changed, 23 insertions, 4 deletions
diff --git a/pkgs/applications/version-management/nbstripout/default.nix b/pkgs/applications/version-management/nbstripout/default.nix
index 324bbf690d5..18fb672226f 100644
--- a/pkgs/applications/version-management/nbstripout/default.nix
+++ b/pkgs/applications/version-management/nbstripout/default.nix
@@ -1,4 +1,4 @@
-{lib, python2Packages, git, mercurial, coreutils}:
+{lib, python2Packages, fetchFromGitHub, fetchurl, git, mercurial, coreutils}:
 
 with python2Packages;
 buildPythonApplication rec {
@@ -12,11 +12,30 @@ buildPythonApplication rec {
   buildInputs = [ pytest pytest-flake8 pytest-cram git pytestrunner ];
   propagatedBuildInputs = [ ipython nbformat ];
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "b997c99b8bbb865988202d2f005cdaabb2598b07dad891c302a147a5871a4a95";
+  # PyPI source is currently missing tests. Thus, use GitHub instead.
+  # See: https://github.com/kynan/nbstripout/issues/73
+  # Use PyPI again after it has been fixed in a release.
+  src = fetchFromGitHub {
+    owner = "kynan";
+    repo = pname;
+    rev = version;
+    sha256 = "1jifqmszjzyaqzaw2ir83k5fdb04iyxdad4lclawpb42hbink9ws";
   };
 
+  patches = [
+    (
+      # Fix git diff tests by using --no-index.
+      # See: https://github.com/kynan/nbstripout/issues/74
+      #
+      # Remove this patch once the pull request has been merged and a new
+      # release made.
+      fetchurl {
+        url = "https://github.com/jluttine/nbstripout/commit/03e28424fb788dd09a95e99814977b0d0846c0b4.patch";
+        sha256 = "09myfb77a2wh8lqqs9fcpam97vmaw8b7zbq8n5gwn6d80zbl7dn0";
+      }
+    )
+  ];
+
   # for some reason, darwin uses /bin/sh echo native instead of echo binary, so
   # force using the echo binary
   postPatch = ''