python3Packages.rembg: 2.0.69 -> 2.0.72

Diff: https://github.com/danielgatis/rembg/compare/v2.0.69...v2.0.72

Changelog: https://github.com/danielgatis/rembg/releases/tag/v2.0.72
This commit is contained in:
Gaetan Lepage
2026-01-14 23:26:25 +00:00
parent fb1d8dc060
commit c2526df7d5
@@ -2,16 +2,15 @@
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
versionCheckHook,
withCli ? false,
# build-system
poetry-core,
poetry-dynamic-versioning,
# dependencies
jsonschema,
numpy,
onnxruntime,
opencv-python-headless,
pillow,
pooch,
pymatting,
@@ -27,31 +26,44 @@
filetype,
gradio,
python-multipart,
sniffio,
uvicorn,
watchdog,
# tests
versionCheckHook,
withCli ? false,
}:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "rembg";
version = "2.0.69";
version = "2.0.72";
pyproject = true;
src = fetchFromGitHub {
owner = "danielgatis";
repo = "rembg";
tag = "v${version}";
hash = "sha256-9Ncs1DHPG3ouU5yFyeH0M2ZCQ9yHqJhVjkDO8fNSqIg=";
tag = "v${finalAttrs.version}";
hash = "sha256-KYpqRuC7EjgH0UqgIoMaeHF3oQSI87j6J3bcqU+43Wo=";
};
env.POETRY_DYNAMIC_VERSIONING_BYPASS = finalAttrs.version;
build-system = [
setuptools
wheel
poetry-core
poetry-dynamic-versioning
];
pythonRelaxDeps = [
"jsonschema"
"pillow"
"pymatting"
"scikit-image"
];
dependencies = [
jsonschema
numpy
opencv-python-headless
onnxruntime
pillow
pooch
@@ -60,7 +72,7 @@ buildPythonPackage rec {
scipy
tqdm
]
++ lib.optionals withCli optional-dependencies.cli;
++ lib.optionals withCli finalAttrs.passthru.optional-dependencies.cli;
optional-dependencies = {
cli = [
@@ -71,6 +83,7 @@ buildPythonPackage rec {
filetype
gradio
python-multipart
sniffio
uvicorn
watchdog
];
@@ -83,16 +96,24 @@ buildPythonPackage rec {
postInstall = lib.optionalString (!withCli) "rm -r $out/bin";
# not running python tests, as they require network access
nativeCheckInputs = lib.optionals withCli [ versionCheckHook ];
nativeCheckInputs = lib.optionals withCli [
versionCheckHook
];
versionCheckKeepEnvironment = [
# Otherwise, fail with:
# RuntimeError: cannot cache function '_make_tree': no locator available for file
# '{{storeDir}}/lib/python3.13/site-packages/pymatting/util/kdtree.py'
"NUMBA_CACHE_DIR"
];
pythonImportsCheck = [ "rembg" ];
meta = {
description = "Tool to remove background from images";
homepage = "https://github.com/danielgatis/rembg";
changelog = "https://github.com/danielgatis/rembg/releases/tag/${src.tag}";
changelog = "https://github.com/danielgatis/rembg/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ defelo ];
mainProgram = "rembg";
};
}
})