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 [
33 numba
34 numpy
35 pillow
36 scipy
37 ]
38 ++ lib.optionals cudaSupport [
39 cupy
40 pyopencl
41 ];
42
43 nativeCheckInputs = [ pytestCheckHook ];
44
45 pythonImportsCheck = [ "pymatting" ];
46
47 disabledTests = [
48 # no access to input data set
49 # see: https://github.com/pymatting/pymatting/blob/master/tests/download_images.py
50 "test_alpha"
51 "test_laplacians"
52 "test_preconditioners"
53 "test_lkm"
54 ];
55
56 meta = with lib; {
57 description = "Python library for alpha matting";
58 homepage = "https://github.com/pymatting/pymatting";
59 changelog = "https://github.com/pymatting/pymatting/blob/v${version}/CHANGELOG.md";
60 license = licenses.mit;
61 maintainers = with maintainers; [ ];
62 };
63}