From d6008300659abc7af06b5dd132fa5488692eaec8 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sat, 2 Nov 2024 22:03:25 +0100 Subject: [PATCH] python312Packages.docling-ibm-models: init at 2.0.3 --- .../docling-ibm-models/default.nix | 75 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 77 insertions(+) create mode 100644 pkgs/development/python-modules/docling-ibm-models/default.nix diff --git a/pkgs/development/python-modules/docling-ibm-models/default.nix b/pkgs/development/python-modules/docling-ibm-models/default.nix new file mode 100644 index 0000000000000..dbd7b4e819ec5 --- /dev/null +++ b/pkgs/development/python-modules/docling-ibm-models/default.nix @@ -0,0 +1,75 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + huggingface-hub, + jsonlines, + lxml, + mean-average-precision, + numpy, + opencv-python-headless, + pillow, + torch, + torchvision, + tqdm, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "docling-ibm-models"; + version = "2.0.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "DS4SD"; + repo = "docling-ibm-models"; + rev = "refs/tags/v${version}"; + hash = "sha256-vSEW1+mFTjUvjjUOoX3aGgT/y8iwP3JGIZaPh9RbX5I="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + huggingface-hub + jsonlines + lxml + mean-average-precision + numpy + opencv-python-headless + pillow + torch + torchvision + tqdm + ]; + + pythonRelaxDeps = [ + "lxml" + "mean_average_precision" + "torchvision" + ]; + + pythonImportsCheck = [ + "docling_ibm_models" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # Requires network access + "test_layoutpredictor" + "test_tf_predictor" + ]; + + meta = { + changelog = "https://github.com/DS4SD/docling-ibm-models/blob/${src.rev}/CHANGELOG.md"; + description = "Docling IBM models"; + homepage = "https://github.com/DS4SD/docling-ibm-models"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 42d5a3b7391ef..55f4fbcfca688 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3680,6 +3680,8 @@ self: super: with self; { dockerspawner = callPackage ../development/python-modules/dockerspawner { }; + docling-ibm-models = callPackage ../development/python-modules/docling-ibm-models { }; + docling-parse = callPackage ../development/python-modules/docling-parse { loguru-cpp = pkgs.loguru; };