1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pillow
5, unittestCheckHook
6}:
7
8buildPythonPackage rec {
9 pname = "diffimg";
10 version = "0.3.0"; # github recognized 0.1.3, there's a v0.1.5 tag and setup.py says 0.3.0
11 format = "setuptools";
12
13 src = fetchFromGitHub {
14 owner = "nicolashahn";
15 repo = "diffimg";
16 rev = "b82f0bb416f100f9105ccccf1995872b29302461";
17 hash = "sha256-H/UQsqyfdnlESBe7yRu6nK/0dakQkAfeFaZNwjCMvdM=";
18 };
19
20 # it imports the wrong diff,
21 # fix offered to upstream https://github.com/nicolashahn/diffimg/pull/6
22 postPatch = ''
23 substituteInPlace diffimg/test.py \
24 --replace "from diff import diff" "from diffimg.diff import diff"
25 '';
26
27 propagatedBuildInputs = [
28 pillow
29 ];
30
31 pythonImportsCheck = [ "diffimg" ];
32
33 nativeCheckInputs = [
34 unittestCheckHook
35 ];
36
37 meta = with lib; {
38 description = "Differentiate images in python - get a ratio or percentage difference, and generate a diff image";
39 homepage = "https://github.com/nicolashahn/diffimg";
40 license = licenses.mit;
41 maintainers = with maintainers; [ evils ];
42 };
43}