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
|
|
|
|
, setuptools-scm
|
2022-12-17 10:02:37 +00:00
|
|
|
, setuptools
|
2022-06-26 10:26:21 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tabula-py";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "2.7.0";
|
|
|
|
format = "pyproject";
|
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";
|
|
|
|
repo = pname;
|
2022-12-28 21:21:41 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-22 10:55:15 +00:00
|
|
|
hash = "sha256-SV4QLvk7dXtU0/husS5A5mBYvbTejLyO9PpiO2oBtjs=";
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
./java-interpreter-path.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's|@JAVA@|${jre}/bin/java|g' $(find -name '*.py')
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
distro
|
|
|
|
numpy
|
|
|
|
pandas
|
2022-12-17 10:02:37 +00:00
|
|
|
setuptools
|
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"
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|