From 6f6adb0b840832a139fc6477988b12163e5407c4 Mon Sep 17 00:00:00 2001 From: natsukium Date: Tue, 7 Nov 2023 12:06:11 +0900 Subject: [PATCH] python311Packages.tabula-py: 2.8.1 -> 2.8.2 Diff: https://github.com/chezou/tabula-py/compare/refs/tags/v2.8.1...v2.8.2 Changelog: https://github.com/chezou/tabula-py/releases/tag/v2.8.2 --- .../python-modules/tabula-py/default.nix | 26 +++++---- .../tabula-py/java-interpreter-path.patch | 54 ------------------- 2 files changed, 17 insertions(+), 63 deletions(-) delete mode 100644 pkgs/development/python-modules/tabula-py/java-interpreter-path.patch diff --git a/pkgs/development/python-modules/tabula-py/default.nix b/pkgs/development/python-modules/tabula-py/default.nix index b985ebf8d893..2bacc67690f0 100644 --- a/pkgs/development/python-modules/tabula-py/default.nix +++ b/pkgs/development/python-modules/tabula-py/default.nix @@ -7,13 +7,14 @@ , pandas , pytestCheckHook , pythonOlder -, setuptools-scm , setuptools +, setuptools-scm +, jpype1 }: buildPythonPackage rec { pname = "tabula-py"; - version = "2.8.1"; + version = "2.8.2"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -22,28 +23,30 @@ buildPythonPackage rec { owner = "chezou"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-QqTfbSwGaNRXBiAzB1fsEawxCvlIunB1j2jSFD9imPI="; + hash = "sha256-Zrq1i+HYXXNulyZ/fv00AgVd7ODj3rP9orLq5rT3ERU="; }; - patches = [ - ./java-interpreter-path.patch - ]; - postPatch = '' - sed -i 's|@JAVA@|${jre}/bin/java|g' $(find -name '*.py') + substituteInPlace tabula/backend.py \ + --replace '"java"' '"${lib.getExe jre}"' ''; SETUPTOOLS_SCM_PRETEND_VERSION = version; nativeBuildInputs = [ + setuptools setuptools-scm ]; + buildInputs = [ + jre + ]; + propagatedBuildInputs = [ distro numpy pandas - setuptools + jpype1 ]; nativeCheckInputs = [ @@ -60,6 +63,11 @@ buildPythonPackage rec { "test_read_pdf_with_remote_template" "test_read_remote_pdf" "test_read_remote_pdf_with_custom_user_agent" + # not sure what it checks + # probably related to jpype, but we use subprocess instead + # https://github.com/chezou/tabula-py/issues/352#issuecomment-1730791540 + # Failed: DID NOT RAISE + "test_read_pdf_with_silent_true" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/tabula-py/java-interpreter-path.patch b/pkgs/development/python-modules/tabula-py/java-interpreter-path.patch deleted file mode 100644 index fcd03628794a..000000000000 --- a/pkgs/development/python-modules/tabula-py/java-interpreter-path.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff -ru origsource/tabula/io.py source/tabula/io.py ---- origsource/tabula/io.py 2022-11-23 17:19:35.419837514 +0100 -+++ source/tabula/io.py 2022-11-23 17:22:08.204194807 +0100 -@@ -79,7 +79,7 @@ - ) - ) - -- args = ["java"] + java_options + ["-jar", _jar_path()] + options.build_option_list() -+ args = ["@JAVA@"] + java_options + ["-jar", _jar_path()] + options.build_option_list() - if path: - args.append(path) - -diff -ru origsource/tabula/util.py source/tabula/util.py ---- origsource/tabula/util.py 2022-11-23 17:19:35.422837521 +0100 -+++ source/tabula/util.py 2022-11-23 17:21:41.514132392 +0100 -@@ -26,7 +26,7 @@ - - try: - res = subprocess.check_output( -- ["java", "-version"], stderr=subprocess.STDOUT -+ ["@JAVA@", "-version"], stderr=subprocess.STDOUT - ).decode() - - except FileNotFoundError: -diff -ru origsource/tests/test_read_pdf_table.py source/tests/test_read_pdf_table.py ---- origsource/tests/test_read_pdf_table.py 2022-11-23 17:19:35.422837521 +0100 -+++ source/tests/test_read_pdf_table.py 2022-11-23 17:21:22.008086776 +0100 -@@ -281,7 +281,7 @@ - - tabula.read_pdf(self.pdf_path, encoding="utf-8") - -- target_args = ["java"] -+ target_args = ["@JAVA@"] - if platform.system() == "Darwin": - target_args += ["-Djava.awt.headless=true"] - target_args += [ -@@ -355,7 +355,7 @@ - - tabula.read_pdf(self.pdf_path, encoding="utf-8", silent=False) - -- target_args = ["java"] -+ target_args = ["@JAVA@"] - if platform.system() == "Darwin": - target_args += ["-Djava.awt.headless=true"] - target_args += [ -@@ -382,7 +382,7 @@ - - tabula.read_pdf(self.pdf_path, encoding="utf-8", silent=True) - -- target_args = ["java"] -+ target_args = ["@JAVA@"] - if platform.system() == "Darwin": - target_args += ["-Djava.awt.headless=true"] - target_args += [