mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
python312Packages.docling-serve: 0.8.0 -> 0.10.1
This commit is contained in:
parent
3429849683
commit
b7a2f556e9
2 changed files with 53 additions and 12 deletions
|
@ -2,9 +2,21 @@
|
|||
python3Packages,
|
||||
nixosTests,
|
||||
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 = {
|
||||
docling-serve = nixosTests.docling-serve;
|
||||
|
|
|
@ -12,24 +12,37 @@
|
|||
python-multipart,
|
||||
uvicorn,
|
||||
websockets,
|
||||
tesserocr,
|
||||
rapidocr-onnxruntime,
|
||||
onnxruntime,
|
||||
torch,
|
||||
torchvision,
|
||||
gradio,
|
||||
nodejs,
|
||||
which,
|
||||
withUI ? false,
|
||||
withTesserocr ? false,
|
||||
withRapidocr ? false,
|
||||
withCPU ? false,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "docling-serve";
|
||||
version = "0.8.0";
|
||||
version = "0.10.1";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "docling-project";
|
||||
repo = "docling-serve";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-ACoqhaGiYHf2dqulxfHQDH/JIhuUlH7wyu0JY4hd0U8=";
|
||||
hash = "sha256-ApI8I14X2BBenEZ9mLXifhgtY1DHdPljMd1LvjbNUXM=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace-fail '"kfp[kubernetes]>=2.10.0",' ""
|
||||
'';
|
||||
|
||||
build-system = [
|
||||
hatchling
|
||||
setuptools-scm
|
||||
|
@ -39,7 +52,8 @@ buildPythonPackage rec {
|
|||
"websockets"
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
dependencies =
|
||||
[
|
||||
docling
|
||||
fastapi
|
||||
httpx
|
||||
|
@ -47,7 +61,11 @@ buildPythonPackage rec {
|
|||
python-multipart
|
||||
uvicorn
|
||||
websockets
|
||||
] ++ lib.optionals withUI optional-dependencies.ui;
|
||||
]
|
||||
++ 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 = {
|
||||
ui = [
|
||||
|
@ -55,6 +73,17 @@ buildPythonPackage rec {
|
|||
nodejs
|
||||
which
|
||||
];
|
||||
tesserocr = [
|
||||
tesserocr
|
||||
];
|
||||
rapidocr = [
|
||||
rapidocr-onnxruntime
|
||||
onnxruntime
|
||||
];
|
||||
cpu = [
|
||||
torch
|
||||
torchvision
|
||||
];
|
||||
};
|
||||
|
||||
pythonImportsCheck = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue