Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, jupyterlab
5, nbexec
6, pandas
7, pandas-stubs
8, pdfminer-six
9, pillow
10, pytest-parallel
11, pytestCheckHook
12, pythonOlder
13, types-pillow
14, wand
15}:
16
17buildPythonPackage rec {
18 pname = "pdfplumber";
19 version = "0.9.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "jsvine";
26 repo = "pdfplumber";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-cGTn1JTSp1YvksemjlvvToZcVauZ7GKINiNmG5f4zKg=";
29 };
30
31 postPatch = ''
32 substituteInPlace setup.cfg \
33 --replace "--cov=pdfplumber --cov-report xml:coverage.xml --cov-report term" ""
34 '';
35
36 propagatedBuildInputs = [
37 pdfminer-six
38 pillow
39 wand
40 ];
41
42 preCheck = ''
43 export HOME=$(mktemp -d)
44 '';
45
46 nativeCheckInputs = [
47 jupyterlab
48 nbexec
49 pandas
50 pandas-stubs
51 pytest-parallel
52 pytestCheckHook
53 types-pillow
54 ];
55
56 pythonImportsCheck = [
57 "pdfplumber"
58 ];
59
60 disabledTests = [
61 # flaky
62 "test__repr_png_"
63 ];
64
65 meta = with lib; {
66 description = "Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables";
67 homepage = "https://github.com/jsvine/pdfplumber";
68 changelog = "https://github.com/jsvine/pdfplumber/releases/tag/v${version}";
69 license = licenses.mit;
70 maintainers = with maintainers; [ happysalada ];
71 };
72}