python312Packages.docling-serve: 0.8.0 -> 0.10.1

This commit is contained in:
Pol Dellaiera 2025-05-07 12:54:29 +02:00
parent 3429849683
commit b7a2f556e9
2 changed files with 53 additions and 12 deletions

View file

@ -2,9 +2,21 @@
python3Packages, python3Packages,
nixosTests, nixosTests,
withUI ? false, withUI ? false,
withTesserocr ? false,
withRapidocr ? false,
withCPU ? false,
}: }:
(python3Packages.toPythonApplication (python3Packages.docling-serve.override { inherit withUI; })) (python3Packages.toPythonApplication (
python3Packages.docling-serve.override {
inherit
withUI
withTesserocr
withRapidocr
withCPU
;
}
))
// { // {
passthru.tests = { passthru.tests = {
docling-serve = nixosTests.docling-serve; docling-serve = nixosTests.docling-serve;

View file

@ -12,24 +12,37 @@
python-multipart, python-multipart,
uvicorn, uvicorn,
websockets, websockets,
tesserocr,
rapidocr-onnxruntime,
onnxruntime,
torch,
torchvision,
gradio, gradio,
nodejs, nodejs,
which, which,
withUI ? false, withUI ? false,
withTesserocr ? false,
withRapidocr ? false,
withCPU ? false,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "docling-serve"; pname = "docling-serve";
version = "0.8.0"; version = "0.10.1";
pyproject = true; pyproject = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "docling-project"; owner = "docling-project";
repo = "docling-serve"; repo = "docling-serve";
tag = "v${version}"; tag = "v${version}";
hash = "sha256-ACoqhaGiYHf2dqulxfHQDH/JIhuUlH7wyu0JY4hd0U8="; hash = "sha256-ApI8I14X2BBenEZ9mLXifhgtY1DHdPljMd1LvjbNUXM=";
}; };
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail '"kfp[kubernetes]>=2.10.0",' ""
'';
build-system = [ build-system = [
hatchling hatchling
setuptools-scm setuptools-scm
@ -39,15 +52,20 @@ buildPythonPackage rec {
"websockets" "websockets"
]; ];
dependencies = [ dependencies =
docling [
fastapi docling
httpx fastapi
pydantic-settings httpx
python-multipart pydantic-settings
uvicorn python-multipart
websockets uvicorn
] ++ lib.optionals withUI optional-dependencies.ui; websockets
]
++ lib.optionals withUI optional-dependencies.ui
++ lib.optionals withTesserocr optional-dependencies.tesserocr
++ lib.optionals withRapidocr optional-dependencies.rapidocr
++ lib.optionals withCPU optional-dependencies.cpu;
optional-dependencies = { optional-dependencies = {
ui = [ ui = [
@ -55,6 +73,17 @@ buildPythonPackage rec {
nodejs nodejs
which which
]; ];
tesserocr = [
tesserocr
];
rapidocr = [
rapidocr-onnxruntime
onnxruntime
];
cpu = [
torch
torchvision
];
}; };
pythonImportsCheck = [ pythonImportsCheck = [