Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / tabula-py / default.nix
blobbdc31012cf2d0ab124e585c07a2a8fcae59714db
1 { lib
2 , buildPythonPackage
3 , distro
4 , fetchFromGitHub
5 , jre
6 , numpy
7 , pandas
8 , pytestCheckHook
9 , pythonOlder
10 , setuptools
11 , setuptools-scm
12 , jpype1
15 buildPythonPackage rec {
16   pname = "tabula-py";
17   version = "2.9.0";
18   pyproject = true;
20   disabled = pythonOlder "3.8";
22   src = fetchFromGitHub {
23     owner = "chezou";
24     repo = "tabula-py";
25     rev = "refs/tags/v${version}";
26     hash = "sha256-MGv2n8DoSjumD3lRcqwI0sEsaEDgs1n+st8DwZuZauo=";
27   };
29   postPatch = ''
30     substituteInPlace tabula/backend.py \
31       --replace '"java"' '"${lib.getExe jre}"'
32   '';
34   nativeBuildInputs = [
35     setuptools
36     setuptools-scm
37   ];
39   buildInputs = [
40     jre
41   ];
43   propagatedBuildInputs = [
44     distro
45     numpy
46     pandas
47     jpype1
48   ];
50   nativeCheckInputs = [
51     pytestCheckHook
52   ];
54   pythonImportsCheck = [
55     "tabula"
56   ];
58   disabledTests = [
59     # Tests require network access
60     "test_convert_remote_file"
61     "test_read_pdf_with_remote_template"
62     "test_read_remote_pdf"
63     "test_read_remote_pdf_with_custom_user_agent"
64     # not sure what it checks
65     # probably related to jpype, but we use subprocess instead
66     # https://github.com/chezou/tabula-py/issues/352#issuecomment-1730791540
67     # Failed: DID NOT RAISE <class 'RuntimeError'>
68     "test_read_pdf_with_silent_true"
69   ];
71   meta = with lib; {
72     description = "Module to extract table from PDF into pandas DataFrame";
73     homepage = "https://github.com/chezou/tabula-py";
74     changelog = "https://github.com/chezou/tabula-py/releases/tag/v${version}";
75     license = licenses.mit;
76     maintainers = with maintainers; [ fab ];
77   };