1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build-system
7, flit-core
8
9# dependencies
10, filetype
11, defusedxml
12
13# optional-dependencies
14, pillow-heif
15
16# tests
17, numpy
18, opencv4
19, pillow
20, pytestCheckHook
21, wand
22}:
23
24buildPythonPackage rec {
25 pname = "willow";
26 version = "1.6.2";
27 format = "pyproject";
28
29 disabled = pythonOlder "2.7";
30
31 src = fetchFromGitHub {
32 owner = "wagtail";
33 repo = "Willow";
34 rev = "refs/tags/v${version}";
35 hash = "sha256-dW2FVN3/mBAhVQ094uBsnXzdyTRKgHUDx0SWLm3g374=";
36 };
37
38 nativeBuildInputs = [
39 flit-core
40 ];
41
42 propagatedBuildInputs = [
43 filetype
44 defusedxml
45 ];
46
47 passthru.optional-dependencies = {
48 heif = [
49 pillow-heif
50 ];
51 };
52
53 nativeCheckInputs = [
54 numpy
55 opencv4
56 pytestCheckHook
57 pillow
58 wand
59 ] ++ passthru.optional-dependencies.heif;
60
61 meta = with lib; {
62 description = "A Python image library that sits on top of Pillow, Wand and OpenCV";
63 homepage = "https://github.com/torchbox/Willow/";
64 license = licenses.bsd2;
65 maintainers = with maintainers; [ desiderius ];
66 };
67
68}