1{
2 lib,
3 buildPythonPackage,
4 camelot,
5 defusedxml,
6 fetchFromGitHub,
7 fonttools,
8 lxml,
9 pikepdf,
10 pillow,
11 pytest-cov-stub,
12 pytestCheckHook,
13 qrcode,
14 setuptools,
15 uharfbuzz,
16}:
17
18buildPythonPackage rec {
19 pname = "fpdf2";
20 version = "2.8.4";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "py-pdf";
25 repo = "fpdf2";
26 tag = version;
27 hash = "sha256-MD1ci80FBX8pVspMPqAX2UaTjymWHReI3lA9J4ZiBio=";
28 };
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 defusedxml
34 fonttools
35 pillow
36 ];
37
38 nativeCheckInputs = [
39 camelot
40 lxml
41 pikepdf
42 pytest-cov-stub
43 pytestCheckHook
44 qrcode
45 uharfbuzz
46 ];
47
48 disabledTestPaths = [
49 "test/table/test_table_extraction.py" # tabula-py not packaged yet
50 "test/signing/test_sign.py" # endesive not packaged yet
51 ];
52
53 disabledTests = [
54 "test_png_url" # tries to download file
55 "test_page_background" # tries to download file
56 "test_share_images_cache" # uses timing functions
57 "test_bidi_character" # tries to download file
58 "test_bidi_conformance" # tries to download file
59 "test_insert_jpg_jpxdecode" # JPEG2000 is broken
60 ];
61
62 meta = {
63 homepage = "https://github.com/py-pdf/fpdf2";
64 description = "Simple PDF generation for Python";
65 changelog = "https://github.com/py-pdf/fpdf2/blob/${src.tag}/CHANGELOG.md";
66 license = lib.licenses.lgpl3Only;
67 maintainers = with lib.maintainers; [ jfvillablanca ];
68 };
69}