Merge pull request #265993 from natsukium/tabula-py/update

authored by Artturi and committed by GitHub 55f883b7 dee87144

+17 -63
+17 -9
pkgs/development/python-modules/tabula-py/default.nix
··· 7 7 , pandas 8 8 , pytestCheckHook 9 9 , pythonOlder 10 + , setuptools 10 11 , setuptools-scm 11 - , setuptools 12 + , jpype1 12 13 }: 13 14 14 15 buildPythonPackage rec { 15 16 pname = "tabula-py"; 16 - version = "2.8.1"; 17 + version = "2.8.2"; 17 18 format = "pyproject"; 18 19 19 20 disabled = pythonOlder "3.8"; ··· 22 23 owner = "chezou"; 23 24 repo = pname; 24 25 rev = "refs/tags/v${version}"; 25 - hash = "sha256-QqTfbSwGaNRXBiAzB1fsEawxCvlIunB1j2jSFD9imPI="; 26 + hash = "sha256-Zrq1i+HYXXNulyZ/fv00AgVd7ODj3rP9orLq5rT3ERU="; 26 27 }; 27 28 28 - patches = [ 29 - ./java-interpreter-path.patch 30 - ]; 31 - 32 29 postPatch = '' 33 - sed -i 's|@JAVA@|${jre}/bin/java|g' $(find -name '*.py') 30 + substituteInPlace tabula/backend.py \ 31 + --replace '"java"' '"${lib.getExe jre}"' 34 32 ''; 35 33 36 34 SETUPTOOLS_SCM_PRETEND_VERSION = version; 37 35 38 36 nativeBuildInputs = [ 37 + setuptools 39 38 setuptools-scm 40 39 ]; 41 40 41 + buildInputs = [ 42 + jre 43 + ]; 44 + 42 45 propagatedBuildInputs = [ 43 46 distro 44 47 numpy 45 48 pandas 46 - setuptools 49 + jpype1 47 50 ]; 48 51 49 52 nativeCheckInputs = [ ··· 60 63 "test_read_pdf_with_remote_template" 61 64 "test_read_remote_pdf" 62 65 "test_read_remote_pdf_with_custom_user_agent" 66 + # not sure what it checks 67 + # probably related to jpype, but we use subprocess instead 68 + # https://github.com/chezou/tabula-py/issues/352#issuecomment-1730791540 69 + # Failed: DID NOT RAISE <class 'RuntimeError'> 70 + "test_read_pdf_with_silent_true" 63 71 ]; 64 72 65 73 meta = with lib; {
-54
pkgs/development/python-modules/tabula-py/java-interpreter-path.patch
··· 1 - diff -ru origsource/tabula/io.py source/tabula/io.py 2 - --- origsource/tabula/io.py 2022-11-23 17:19:35.419837514 +0100 3 - +++ source/tabula/io.py 2022-11-23 17:22:08.204194807 +0100 4 - @@ -79,7 +79,7 @@ 5 - ) 6 - ) 7 - 8 - - args = ["java"] + java_options + ["-jar", _jar_path()] + options.build_option_list() 9 - + args = ["@JAVA@"] + java_options + ["-jar", _jar_path()] + options.build_option_list() 10 - if path: 11 - args.append(path) 12 - 13 - diff -ru origsource/tabula/util.py source/tabula/util.py 14 - --- origsource/tabula/util.py 2022-11-23 17:19:35.422837521 +0100 15 - +++ source/tabula/util.py 2022-11-23 17:21:41.514132392 +0100 16 - @@ -26,7 +26,7 @@ 17 - 18 - try: 19 - res = subprocess.check_output( 20 - - ["java", "-version"], stderr=subprocess.STDOUT 21 - + ["@JAVA@", "-version"], stderr=subprocess.STDOUT 22 - ).decode() 23 - 24 - except FileNotFoundError: 25 - diff -ru origsource/tests/test_read_pdf_table.py source/tests/test_read_pdf_table.py 26 - --- origsource/tests/test_read_pdf_table.py 2022-11-23 17:19:35.422837521 +0100 27 - +++ source/tests/test_read_pdf_table.py 2022-11-23 17:21:22.008086776 +0100 28 - @@ -281,7 +281,7 @@ 29 - 30 - tabula.read_pdf(self.pdf_path, encoding="utf-8") 31 - 32 - - target_args = ["java"] 33 - + target_args = ["@JAVA@"] 34 - if platform.system() == "Darwin": 35 - target_args += ["-Djava.awt.headless=true"] 36 - target_args += [ 37 - @@ -355,7 +355,7 @@ 38 - 39 - tabula.read_pdf(self.pdf_path, encoding="utf-8", silent=False) 40 - 41 - - target_args = ["java"] 42 - + target_args = ["@JAVA@"] 43 - if platform.system() == "Darwin": 44 - target_args += ["-Djava.awt.headless=true"] 45 - target_args += [ 46 - @@ -382,7 +382,7 @@ 47 - 48 - tabula.read_pdf(self.pdf_path, encoding="utf-8", silent=True) 49 - 50 - - target_args = ["java"] 51 - + target_args = ["@JAVA@"] 52 - if platform.system() == "Darwin": 53 - target_args += ["-Djava.awt.headless=true"] 54 - target_args += [