summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/willow/default.nix
blob: 36e258874a33dda3a67673590e6aad5823c28a33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
  lib,
  buildPythonPackage,
  defusedxml,
  fetchFromGitHub,
  filetype,
  flit-core,
  opencv4,
  pillow-heif,
  pillow,
  pytestCheckHook,
  wand,
}:

buildPythonPackage rec {
  pname = "willow";
  version = "1.12.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "wagtail";
    repo = "Willow";
    tag = "v${version}";
    hash = "sha256-vboQwOEDRdbwmLT2EW1iF98ZuyzEzlrP2k2ZcvVKjFE=";
  };

  build-system = [ flit-core ];

  dependencies = [
    filetype
    defusedxml
  ];

  optional-dependencies = {
    wand = [ wand ];
    pillow = [ pillow ];
    heif = [ pillow-heif ];
  };

  nativeCheckInputs = [
    opencv4
    pytestCheckHook
  ]
  ++ lib.concatAttrValues optional-dependencies;

  meta = {
    description = "Python image library that sits on top of Pillow, Wand and OpenCV";
    homepage = "https://github.com/torchbox/Willow/";
    changelog = "https://github.com/wagtail/Willow/releases/tag/v${version}";
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [
      kuflierl
    ];
  };
}