From e72c2aa530dace3b81b1f301c1e1693b0ca231fb Mon Sep 17 00:00:00 2001 From: emaryn Date: Mon, 9 Jun 2025 13:26:15 +0800 Subject: [PATCH] python313Packages.paddleocr: 2.9.1 -> 3.0.1 Diff: https://github.com/PaddlePaddle/PaddleOCR/compare/refs/tags/v2.9.1...refs/tags/v3.0.1 Changelog: https://github.com/PaddlePaddle/PaddleOCR/releases/tag/v3.0.1 --- .../python-modules/paddleocr/default.nix | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/paddleocr/default.nix b/pkgs/development/python-modules/paddleocr/default.nix index df9cb443b2d1..77c35499f537 100644 --- a/pkgs/development/python-modules/paddleocr/default.nix +++ b/pkgs/development/python-modules/paddleocr/default.nix @@ -2,6 +2,8 @@ lib, buildPythonPackage, fetchFromGitHub, + setuptools, + setuptools-scm, attrdict, beautifulsoup4, cython, @@ -24,21 +26,20 @@ paddlepaddle, lanms-neo, polygon3, + paddlex, + pyyaml, }: -let - version = "2.9.1"; -in buildPythonPackage rec { pname = "paddleocr"; - inherit version; - format = "setuptools"; + version = "3.0.1"; + pyproject = true; src = fetchFromGitHub { owner = "PaddlePaddle"; repo = "PaddleOCR"; tag = "v${version}"; - hash = "sha256-QCddxgVdLaAJLfKCy+tnQsxownfl1Uv0TXhFRiFi9cY="; + hash = "sha256-B8zIiRpvT0oa/Gg2dLXTqBZmM+XDH3sOzODvleN638E="; }; patches = [ @@ -53,6 +54,16 @@ buildPythonPackage rec { ./remove-import-imaug.patch ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "==72.1.0" "" + ''; + + build-system = [ + setuptools + setuptools-scm + ]; + # trying to relax only pymupdf makes the whole build fail pythonRelaxDeps = true; pythonRemoveDeps = [ @@ -61,7 +72,7 @@ buildPythonPackage rec { "opencv-contrib-python" ]; - propagatedBuildInputs = [ + dependencies = [ attrdict beautifulsoup4 cython @@ -84,6 +95,8 @@ buildPythonPackage rec { paddlepaddle lanms-neo polygon3 + paddlex + pyyaml ]; # TODO: The tests depend, among possibly other things, on `cudatoolkit`. @@ -92,16 +105,16 @@ buildPythonPackage rec { # nativeCheckInputs = with pkgs; [ which cudatoolkit ]; doCheck = false; - meta = with lib; { + meta = { homepage = "https://github.com/PaddlePaddle/PaddleOCR"; - license = licenses.asl20; + license = lib.licenses.asl20; description = "Multilingual OCR toolkits based on PaddlePaddle"; longDescription = '' PaddleOCR aims to create multilingual, awesome, leading, and practical OCR tools that help users train better models and apply them into practice. ''; changelog = "https://github.com/PaddlePaddle/PaddleOCR/releases/tag/${src.tag}"; - maintainers = with maintainers; [ happysalada ]; + maintainers = with lib.maintainers; [ happysalada ]; platforms = [ "x86_64-linux" "x86_64-darwin"