Skip to content

Commit 3d6ac6a

Browse files
authored
python312Packages.{pdfplumber,unstructured-api}: require pypdfium2 (#378649)
2 parents 8c5b9f7 + e8a1eaa commit 3d6ac6a

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

pkgs/development/python-modules/pdfplumber/default.nix

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,36 @@
99
pandas-stubs,
1010
pdfminer-six,
1111
pillow,
12+
pypdfium2,
13+
pytest-cov,
1214
pytest-parallel,
1315
pytestCheckHook,
14-
pythonOlder,
1516
types-pillow,
16-
wand,
1717
}:
1818

1919
buildPythonPackage rec {
2020
pname = "pdfplumber";
2121
version = "0.11.5";
2222
format = "setuptools";
2323

24-
disabled = pythonOlder "3.7";
25-
2624
src = fetchFromGitHub {
2725
owner = "jsvine";
2826
repo = "pdfplumber";
2927
tag = "v${version}";
3028
hash = "sha256-oe6lZyQKXASzG7Ho6o7mlXY+BOgVBaACebxbYD+1+x0=";
3129
};
3230

33-
postPatch = ''
34-
substituteInPlace setup.cfg \
35-
--replace "--cov=pdfplumber --cov-report xml:coverage.xml --cov-report term" ""
36-
'';
37-
38-
propagatedBuildInputs = [
31+
dependencies = [
3932
pdfminer-six
4033
pillow
41-
wand
34+
pypdfium2
4235
];
4336

4437
preCheck = ''
4538
export HOME=$(mktemp -d)
39+
# test_issue_1089 assumes the soft limit on open files is "low", otherwise it never completes
40+
# reported at: https://github.com/jsvine/pdfplumber/issues/1263
41+
ulimit -n 1024
4642
'';
4743

4844
nativeCheckInputs = [
@@ -51,31 +47,20 @@ buildPythonPackage rec {
5147
nbexec
5248
pandas
5349
pandas-stubs
50+
pytest-cov
5451
pytest-parallel
5552
pytestCheckHook
5653
types-pillow
5754
];
5855

5956
pythonImportsCheck = [ "pdfplumber" ];
6057

61-
disabledTests = [
62-
# flaky
63-
"test__repr_png_"
64-
];
65-
66-
disabledTestPaths = [
67-
# Tests requires pypdfium2
68-
"tests/test_display.py"
69-
# Tests requires pypdfium2
70-
"tests/test_issues.py"
71-
];
72-
73-
meta = with lib; {
58+
meta = {
7459
description = "Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables";
7560
mainProgram = "pdfplumber";
7661
homepage = "https://github.com/jsvine/pdfplumber";
7762
changelog = "https://github.com/jsvine/pdfplumber/releases/tag/v${version}";
78-
license = licenses.mit;
79-
maintainers = with maintainers; [ happysalada ];
63+
license = lib.licenses.mit;
64+
maintainers = with lib.maintainers; [ happysalada ];
8065
};
8166
}

pkgs/servers/unstructured-api/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ let
100100
pypandoc
101101
pyparsing
102102
pypdf
103-
# pypdfium2
103+
pypdfium2
104104
python-dateutil
105105
python-docx
106106
# python-iso639

0 commit comments

Comments
 (0)