python312Packages.rembg, rembg: init at 2.0.62 (#383654)

This commit is contained in:
Gaétan Lepage
2025-03-28 11:50:54 +01:00
committed by GitHub
4 changed files with 147 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
{ python3Packages }:
python3Packages.toPythonApplication (python3Packages.rembg.override { withCli = true; })
@@ -0,0 +1,41 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pdm-backend,
anyio,
typing-extensions,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "asyncer";
version = "0.0.8";
pyproject = true;
src = fetchFromGitHub {
owner = "fastapi";
repo = "asyncer";
tag = version;
hash = "sha256-SbByOiTYzp+G+SvsDqXOQBAG6nigtBXiQmfGgfKRqvM=";
};
build-system = [ pdm-backend ];
dependencies = [
anyio
typing-extensions
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "asyncer" ];
meta = {
description = "Asyncer, async and await, focused on developer experience";
homepage = "https://github.com/fastapi/asyncer";
changelog = "https://github.com/fastapi/asyncer/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ defelo ];
};
}
@@ -0,0 +1,99 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
versionCheckHook,
withCli ? false,
# dependencies
jsonschema,
numpy,
onnxruntime,
opencv-python-headless,
pillow,
pooch,
pymatting,
scikit-image,
scipy,
tqdm,
# optional-dependencies
aiohttp,
asyncer,
click,
fastapi,
filetype,
gradio,
python-multipart,
uvicorn,
watchdog,
}:
buildPythonPackage rec {
pname = "rembg";
version = "2.0.65";
pyproject = true;
src = fetchFromGitHub {
owner = "danielgatis";
repo = "rembg";
tag = "v${version}";
hash = "sha256-o6M3DSW1GL3xvEx4lsE325J3XcmRrhhPszS5MkaynsE=";
};
build-system = [
setuptools
wheel
];
dependencies = [
jsonschema
numpy
opencv-python-headless
onnxruntime
pillow
pooch
pymatting
scikit-image
scipy
tqdm
] ++ lib.optionals withCli optional-dependencies.cli;
optional-dependencies = {
cli = [
aiohttp
asyncer
click
fastapi
filetype
gradio
python-multipart
uvicorn
watchdog
];
};
preConfigure = ''
export NUMBA_CACHE_DIR="$(mktemp -d)"
'';
postInstall = lib.optionalString (!withCli) "rm -r $out/bin";
# not running python tests, as they require network access
nativeCheckInputs = lib.optionals withCli [ versionCheckHook ];
versionCheckProgramArg = "--version";
pythonImportsCheck = [ "rembg" ];
meta = {
description = "Tool to remove background from images";
homepage = "https://github.com/danielgatis/rembg";
changelog = "https://github.com/danielgatis/rembg/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ defelo ];
mainProgram = "rembg";
platforms = [ "x86_64-linux" ];
};
}
+4
View File
@@ -994,6 +994,8 @@ self: super: with self; {
asynccmd = callPackage ../development/python-modules/asynccmd { };
asyncer = callPackage ../development/python-modules/asyncer { };
asyncinotify = callPackage ../development/python-modules/asyncinotify { };
asyncio-dgram = callPackage ../development/python-modules/asyncio-dgram { };
@@ -14735,6 +14737,8 @@ self: super: with self; {
remarshal = callPackage ../development/python-modules/remarshal { };
rembg = callPackage ../development/python-modules/rembg { };
remctl = callPackage ../development/python-modules/remctl { remctl-c = pkgs.remctl; };
remi = callPackage ../development/python-modules/remi { };