python3Packages.pymatting: cleanup

This commit is contained in:
Gaetan Lepage 2026-03-03 23:31:41 +00:00
parent fad1d272ba
commit 58a43653b3

View file

@ -2,19 +2,27 @@
lib, lib,
buildPythonPackage, buildPythonPackage,
fetchFromGitHub, fetchFromGitHub,
# build-system
setuptools,
# dependencies
numba, numba,
numpy, numpy,
pillow, pillow,
pytestCheckHook,
scipy, scipy,
setuptools, # cuda-only
config,
cudaSupport ? config.cudaSupport,
cupy, cupy,
pyopencl, pyopencl,
# tests
pytestCheckHook,
config,
cudaSupport ? config.cudaSupport,
}: }:
buildPythonPackage rec { buildPythonPackage (finalAttrs: {
pname = "pymatting"; pname = "pymatting";
version = "1.1.15"; version = "1.1.15";
pyproject = true; pyproject = true;
@ -22,7 +30,7 @@ buildPythonPackage rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "pymatting"; owner = "pymatting";
repo = "pymatting"; repo = "pymatting";
tag = "v${version}"; tag = "v${finalAttrs.version}";
hash = "sha256-rcatlQE+YgppY//ZgGY9jO5KI0ED30fLlqW9N+xRNqk="; hash = "sha256-rcatlQE+YgppY//ZgGY9jO5KI0ED30fLlqW9N+xRNqk=";
}; };
@ -39,10 +47,10 @@ buildPythonPackage rec {
pyopencl pyopencl
]; ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "pymatting" ]; pythonImportsCheck = [ "pymatting" ];
nativeCheckInputs = [ pytestCheckHook ];
disabledTests = [ disabledTests = [
# no access to input data set # no access to input data set
# see: https://github.com/pymatting/pymatting/blob/master/tests/download_images.py # see: https://github.com/pymatting/pymatting/blob/master/tests/download_images.py
@ -52,14 +60,16 @@ buildPythonPackage rec {
"test_lkm" "test_lkm"
]; ];
# pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR disabledTestPaths = lib.optionals cudaSupport [
disabledTestPaths = lib.optional cudaSupport "tests/test_foreground.py"; # pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR
"tests/test_foreground.py"
];
meta = { meta = {
description = "Python library for alpha matting"; description = "Python library for alpha matting";
homepage = "https://github.com/pymatting/pymatting"; homepage = "https://github.com/pymatting/pymatting";
changelog = "https://github.com/pymatting/pymatting/blob/v${version}/CHANGELOG.md"; changelog = "https://github.com/pymatting/pymatting/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = lib.licenses.mit; license = lib.licenses.mit;
maintainers = [ ]; maintainers = [ ];
}; };
} })