build(deps): allow pypdf 7

IT
3d ago
+5-5

Summary

Allow pypdf 7. The pdf extra (and image, local-inference and all-docs through it) capped pypdf at <7.0.0. pypdf 7.0.0 was released on 6 Nov, so unstructured[pdf] couldn't be installed next to packages that require it. The cap is now <8.0.0, and uv.lock changes only in the requires-dist specifiers (uv lock --check passes).

unstructured uses PdfReader(...).get_num_pages(), reader.pages, IndirectObject / ArrayObject and pypdf.errors.LimitReachedError, and all of these are unchanged in 7.0. The 7.0 changes are stricter security limits, removal of APIs deprecated in earlier releases (none used here), and dropping Python 3.9 (unstructured already requires 3.11+).

Validation

pytest test_unstructured/partition/pdf_image/test_pdf.py -k "page_number or max_pages or annotation or link or password or check_pdf or fast" on Python 3.12 with the pdf extra: 53 passed with both pypdf 6.21.4 and 7.0.0. The same 20 tests fail on both because there's no Tesseract/OCR on my machine.

Checklist

  • The PR title is a user-facing release-note entry with a conventional commit prefix.
  • Apply a category label (enhancement, bug, or an appropriate existing label), or ask a maintainer to apply it.
  • For breaking changes, use ! in the title and explain impact and migration above.