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