From 633ebcf7dc3febd5833f21e035a51a33450da3e7 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sat, 2 Nov 2024 19:25:16 +0100 Subject: [PATCH] python312Packages.docling-parse: init at 2.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: GaƩtan Lepage <33058747+GaetanLepage@users.noreply.github.com> --- .../python-modules/docling-parse/default.nix | 80 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 + 2 files changed, 84 insertions(+) create mode 100644 pkgs/development/python-modules/docling-parse/default.nix diff --git a/pkgs/development/python-modules/docling-parse/default.nix b/pkgs/development/python-modules/docling-parse/default.nix new file mode 100644 index 0000000000000..b4921a02cd31e --- /dev/null +++ b/pkgs/development/python-modules/docling-parse/default.nix @@ -0,0 +1,80 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + cmake, + pkg-config, + cxxopts, + poetry-core, + pybind11, + tabulate, + zlib, + nlohmann_json, + utf8cpp, + libjpeg, + qpdf, + loguru-cpp, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "docling-parse"; + version = "2.0.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "DS4SD"; + repo = "docling-parse"; + rev = "refs/tags/v${version}"; + hash = "sha256-unXGmMp5xyRCqSoFmqcQAZOBzpE0EzgEEBIfZUHhRcQ="; + }; + + dontUseCmakeConfigure = true; + + build-system = [ + cmake + poetry-core + pybind11 + pkg-config + ]; + + env.NIX_CFLAGS_COMPILE = [ + "-I${lib.getDev utf8cpp}/include/utf8cpp" + ]; + + buildInputs = [ + cxxopts + libjpeg + loguru-cpp + nlohmann_json + qpdf + utf8cpp + zlib + ]; + + env.USE_SYSTEM_DEPS = true; + + cmakeFlags = [ + "-DUSE_SYSTEM_DEPS=True" + ]; + + dependencies = [ + tabulate + ]; + + pythonImportsCheck = [ + "docling_parse" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = { + changelog = "https://github.com/DS4SD/docling-parse/blob/${src.rev}/CHANGELOG.md"; + description = "Simple package to extract text with coordinates from programmatic PDFs"; + homepage = "https://github.com/DS4SD/docling-parse"; + 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 a9ba637bc5daa..42d5a3b7391ef 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3680,6 +3680,10 @@ self: super: with self; { dockerspawner = callPackage ../development/python-modules/dockerspawner { }; + docling-parse = callPackage ../development/python-modules/docling-parse { + loguru-cpp = pkgs.loguru; + }; + docloud = callPackage ../development/python-modules/docloud { }; docstr-coverage = callPackage ../development/python-modules/docstr-coverage { };