2022-06-26 10:26:21 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, distro
|
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, jre
|
2022-06-26 10:26:21 +00:00
|
|
|
, numpy
|
|
|
|
, pandas
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2022-12-17 10:02:37 +00:00
|
|
|
, setuptools
|
2023-11-16 04:20:00 +00:00
|
|
|
, setuptools-scm
|
|
|
|
, jpype1
|
2022-06-26 10:26:21 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tabula-py";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "2.9.0";
|
|
|
|
pyproject = true;
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chezou";
|
2024-01-02 11:29:13 +00:00
|
|
|
repo = "tabula-py";
|
2022-12-28 21:21:41 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-MGv2n8DoSjumD3lRcqwI0sEsaEDgs1n+st8DwZuZauo=";
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
postPatch = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
substituteInPlace tabula/backend.py \
|
|
|
|
--replace '"java"' '"${lib.getExe jre}"'
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
nativeBuildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
setuptools
|
2022-06-26 10:26:21 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildInputs = [
|
|
|
|
jre
|
|
|
|
];
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
distro
|
|
|
|
numpy
|
|
|
|
pandas
|
2023-11-16 04:20:00 +00:00
|
|
|
jpype1
|
2022-06-26 10:26:21 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-26 10:26:21 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"tabula"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_convert_remote_file"
|
|
|
|
"test_read_pdf_with_remote_template"
|
|
|
|
"test_read_remote_pdf"
|
|
|
|
"test_read_remote_pdf_with_custom_user_agent"
|
2023-11-16 04:20:00 +00:00
|
|
|
# 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 <class 'RuntimeError'>
|
|
|
|
"test_read_pdf_with_silent_true"
|
2022-06-26 10:26:21 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Module to extract table from PDF into pandas DataFrame";
|
|
|
|
homepage = "https://github.com/chezou/tabula-py";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/chezou/tabula-py/releases/tag/v${version}";
|
2022-06-26 10:26:21 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|