1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 numba,
6 numpy,
7 pillow,
8 pytestCheckHook,
9 scipy,
10 setuptools,
11 config,
12 cudaSupport ? config.cudaSupport,
13 cupy,
14 pyopencl,
15}:
16
17buildPythonPackage rec {
18 pname = "pymatting";
19 version = "1.1.13";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "pymatting";
24 repo = "pymatting";
25 tag = "v${version}";
26 hash = "sha256-AzdhRZgcT+gfLPZYKJLQUW7uLyXoRy6SP2raHWd9XUY=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 numba
33 numpy
34 pillow
35 scipy
36 ]
37 ++ lib.optionals cudaSupport [
38 cupy
39 pyopencl
40 ];
41
42 nativeCheckInputs = [ pytestCheckHook ];
43
44 pythonImportsCheck = [ "pymatting" ];
45
46 disabledTests = [
47 # no access to input data set
48 # see: https://github.com/pymatting/pymatting/blob/master/tests/download_images.py
49 "test_alpha"
50 "test_laplacians"
51 "test_preconditioners"
52 "test_lkm"
53 ];
54
55 meta = with lib; {
56 description = "Python library for alpha matting";
57 homepage = "https://github.com/pymatting/pymatting";
58 changelog = "https://github.com/pymatting/pymatting/blob/v${version}/CHANGELOG.md";
59 license = licenses.mit;
60 maintainers = with maintainers; [ ];
61 };
62}