28 buildPythonPackage rec {
33 src = fetchFromGitHub {
36 rev = "refs/tags/${version}";
37 # fetch sample files used in tests
38 fetchSubmodules = true;
39 hash = "sha256-Z3flDC102FwEaNtef0YAfmAFSxpimQNyxt9tRfpKueg=";
44 # add missing test marker on networked test
45 url = "https://github.com/py-pdf/pypdf/commit/f43268734a529d4098e6258bf346148fd24c54f0.patch";
47 "tests/test_generic.py"
49 hash = "sha256-Ow32UB4crs3OgT+AmA9TNmcO5Y9SoSahybzD3AmWmVk=";
68 substituteInPlace pyproject.toml \
69 --replace "--disable-socket" ""
72 propagatedBuildInputs = lib.optionals (pythonOlder "3.10") [
76 passthru.optional-dependencies = rec {
77 full = crypto ++ image;
86 pythonImportsCheck = [
91 (fpdf2.overridePythonAttrs { doCheck = false; }) # avoid reference loop
94 ] ++ passthru.optional-dependencies.full;
97 # don't access the network
98 "-m" "'not enable_socket'"
102 # requires fpdf2 which we don't package yet
104 # infinite recursion when including fpdf2
105 "test_merging_many_temporary_files"
109 description = "A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files";
110 homepage = "https://github.com/py-pdf/pypdf";
111 changelog = "https://github.com/py-pdf/pypdf/blob/${src.rev}/CHANGELOG.md";
112 license = licenses.bsd3;
113 maintainers = with maintainers; [ ];