Package Details: python-pypdf2 1:4.2.0-3

Git Clone URL: (read-only, click to copy)
Package Base: python-pypdf2
Description: Python library for manipulating pages of PDF files (legacy v2)
Upstream URL:
Licenses: BSD
Submitter: arojas
Maintainer: TurtleRuss
Last Packager: TurtleRuss
Votes: 33
Popularity: 1.96
First Submitted: 2019-07-30 05:58 (UTC)
Last Updated: 2024-05-23 16:01 (UTC)

Latest Comments

1 2 3 4 5 Next › Last »

TrialnError commented on 2024-06-04 20:16 (UTC)

That should work. But still doesn't really the answer the question, why this PKGBUILD was updated and brought alongside python-pypdf. If there is a python program, which needs pypdf >3.0.0 to work it needs to depend on python-pypdf and not this. If it is somehow really checking for pypdf2 and still requires >3.0.0 to work, this should be brought up upstream, as there may be something going wrong.

alan1world commented on 2024-05-26 00:49 (UTC)

Try this for the PKGBUILD:

# Maintainer: Turtle Russ <>
# Contributor: mark.blakeney at bullet-systems dot net
# Contributor: Yuanji <>
# Contributor: Antonio Rojas <>
# Contributor: Francois Boulogne <fboulogne at april dot org>

pkgdesc='Python library for manipulating pages of PDF files (legacy v2)'
depends=(python python-pillow python-cryptography python-pycryptodome python-typing_extensions)
makedepends=(python-setuptools python-build python-installer python-wheel python-flit-core)

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation

  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

bulletmark commented on 2024-05-24 22:29 (UTC) (edited on 2024-05-24 22:30 (UTC) by bulletmark)

@TurtleRuss, yes TriainError is correct. Please restore this package back to 2.12.1. You will have to bump the epoch to 2. Perhaps also change the url in the PKGBUILD to which is more appropriate now. The current 4.2.0 version is available in the standard packages at python-pypdf which you have inadvertently duplicated.

TrialnError commented on 2024-05-24 17:38 (UTC)

Isn't this package now broken for other programs that requires pypdf2 with the bump to the latest release? It was deliberatly left at version 2.x, because afterwards upstream unified the various pypdf project attempts and 3.x and forward weren't compatible with the old API?
Of note is that 3.0.0 apparantly already broke things and therefore this was left at the latest 2.x release.
Didn't test with stapler-git yet, but for that reason also avoiding to build a new package pypdf2 package because I am still irritated why this legacy got updated to the latest version of pypdf (which is not pypdf2).

simon.wiles commented on 2024-05-24 04:35 (UTC)

Yeah this package as been completely borked with the recent change; thank you @alan1world for the fix :)

alan1world commented on 2024-05-23 18:12 (UTC) (edited on 2024-05-23 18:12 (UTC) by alan1world)

Using patch, the PKGBUILD would look something like this:

prepare() {
  mv pypdf-$pkgver $_name-$pkgver
  mv $_name-$pkgver/pypdf $_name-$pkgver/PyPDF2
  patch --directory=$_name-$pkgver --forward --strip=1 --input=../PyPDF2-4.2.0.patch

and the patch (PyPDF2-4.2.0.patch) would look like:

Only in PyPDF2-4.2.0.orig: pypdf
Only in PyPDF2
diff --unified --recursive --text PyPDF2-4.2.0.orig/pyproject.toml
--- PyPDF2-4.2.0.orig/pyproject.toml    2024-04-07 13:37:08.000000000 +0100
+++ 2024-05-23 18:47:12.802062253 +0100
@@ -3,7 +3,7 @@
 build-backend = "flit_core.buildapi"

-name = "pypdf"
+name = "PyPDF2"
 authors = [{ name = "Mathieu Fenniak", email = "" }]
 maintainers = [{ name = "Martin Thoma", email = "" }]
 description = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files"
@@ -59,7 +59,7 @@
 tests_dir = "tests/"

-package = "./pypdf"
+package = "./PyPDF2"

 exclude = [".github/*", "docs/*", "resources/*", "sample-files/*", "sample-files/.github/*", "sample-files/.gitignore", "sample-files/.pre-commit-config.yaml",  "requirements/*", "tests/*", ".flake8", ".gitignore", ".gitmodules", ".pylintrc", "tox.ini", "", "", ".pre-commit-config.yaml", ".gitblame-ignore-revs", "Makefile", ""]
@@ -83,7 +83,7 @@
 known_third_party = ["pytest", "setuptools"]

-source = ["pypdf"]
+source = ["PyPDF2"]
 branch = true

@@ -203,7 +203,7 @@
 "docs/" = ["PTH", "INP001"]
 "" = ["T201"]
 "" = ["T201", "S603", "S607"]
-"pypdf/*" = ["N802", "N803"]  # We first need to deprecate old stuff:
+"PyPDF2/*" = ["N802", "N803"]  # We first need to deprecate old stuff:
 "sample-files/*" = ["D100", "INP001"]
 "tests/*" = ["S101", "ANN001", "ANN201","D104", "S105", "S106", "D103", "B018", "B017"]
 "tests/" =  ["T201"]

alan1world commented on 2024-05-23 17:52 (UTC) (edited on 2024-05-23 17:52 (UTC) by alan1world)

The repo now builds to a site library folder of pypdf rather than PyPDF2, causing a conflict with the pypdf package.

This package could be marked with a conflict against the python-pypdf package. However, since this is the legacy package with a lot of applications expecting to import from PyPDF2, it would be preferable to amend the package to build to PyPDF2.

No changes are needed to the package build, I made the changes manually (because I can't remember how to build a patch file) and re-ran with makepkg -e.


  • source folder pypdf -> PyPDF2
  • pyproject.toml project name pypdf -> PyPDF2
  • pyproject.toml tool.check-wheel-contents pypdf -> PyPDF2
  • pyproject.toml pypdf -> PyPDF2
  • pyproject.toml tool.ruff.per-file-ignores pypdf/ -> PyPDF2/

Those changes build to a site-library folder of PyPDF2.

Using bookletimposer as a test, this now runs.

bulletmark commented on 2023-01-20 07:15 (UTC)

Actually, I just pushed 1:2.12.1-3 which changes the name of the download file and thus forces it to be re-downloaded to avoid this issue for any future users who may still have the old file cached.

bulletmark commented on 2023-01-20 06:53 (UTC)

@DrMartinus, read my previous comment here.