Repository navigation
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017F3tye3cHFqzsJWqepu2rG
This was referenced Nov 21, 2026
…below 2 Raise lower bounds of all direct dependencies (runtime, logging extra and dev group) to the versions in uv.lock, so the refreshed lock is reflected in the pyproject metadata. Cap pymupdf at <2 (floor 1.28.2): 2.x makes numpy, onnxruntime, networkx, psutil, pyyaml, tabulate, pymupdf-layout and pymupdf4llm hard dependencies and ships fewer wheel platforms (no musllinux, win32 or macOS x86_64), while TextSpitter only uses pymupdf.open() and page text extraction. Re-locked: 8 transitive packages drop out of the lock. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017F3tye3cHFqzsJWqepu2rG
…rupt PDFs Force the PyMuPDF branch to fail (core.pymupdf = None) and assert the documented behaviour of FileExtractor.pdf_file_read: text for a valid PDF, empty string (no exception) for encrypted, corrupt and truncated input. Behaviour verified identical on pypdf 6.7.1 and 7.1.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017F3tye3cHFqzsJWqepu2rG
- Add primary-path tests (PyMuPDF 1.28.2 active, pypdf fallback trapped): valid, multi-page, truncated-but-repairable, corrupt, and forced PyMuPDF failure falling back to pypdf. - Replace the loose isinstance check for truncated PDFs with exact expectations on pypdf 7.1.1: a cut inside the %%EOF marker is recovered; losing the xref/trailer yields "". - Build fixture PDFs with public pypdf APIs only (no _add_object). - Add cryptography (>=50.0.2, the locked version) to the dev group for pypdf AES encryption; lock refreshed without changing any version. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017F3tye3cHFqzsJWqepu2rG
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One
uv lock --upgraderefresh ofuv.lock, replacing the individual Dependabot bumps. 96 packages changed, 2 added (jupyter-builder,nest-asyncio2);decorator,nest-asyncioandsetuptoolsdropped (all dev/Jupyter-only, see follow-ups).Breaking-level jumps (major, or 0.x minor)
26 packages. The ones that touch behavior: pypdf 6.7.1 -> 7.1.1, loguru 0.7.3 -> 0.8.0, rich 14 -> 15, python-dateutil 2.9 -> 4.0.0, more-itertools 10 -> 11, cryptography 46 -> 50, tiktoken 0.13 -> 0.14. Tooling: ruff 0.15 -> 0.17, isort 7 -> 9, twine 6 -> 7, docutils 0.22 -> 0.23, readme-renderer 44 -> 46. The
textspitter 1.0.0 -> 2.0.0b1line is only the project's own version being recorded in the lock (pyproject already says 2.0.0b1).Functionality checks
core.pyopens PDFs withpymupdf.open(stream=..., filetype="pdf")and falls back topypdf.PdfReader. On a generated 3-page PDF (accented characters, punctuation, numbers) both libraries produce byte-identical text on the old pins (pymupdf 1.27.1 / pypdf 6.7.1) and the new ones (pymupdf 2.1 / pypdf 7.1.1, checked before the pymupdf cap below).Verification (local; GitHub Actions cannot run, the account's GitHub budget is used up)
uv lock --check: clean.uv run --frozen pytest: 245 passed (239 before plus 6 new fallback tests).ruff check .: all checks passed.ruff format --checkreports files to reformat both before and after this change (existing drift, left untouched here).Supersedes (to be closed separately): #18 and #20 (Dependabot pins in the old requirements.txt files; pypdf2 is no longer a dependency and ipython is covered by the lock)
Review follow-ups
Floors: every direct dependency in
pyproject.toml(runtime,loggingextra,devgroup; 20 specs) now has a lower bound equal to its locked version, becauseuv.lockis built frompyproject.toml. Only requires-dist metadata and the pymupdf hold changed in the lock;uv lock --checkpasses. No==pins exist.>=1.28.2,<2(owner decision). pymupdf 2.1 makesnetworkx,numpy,onnxruntime,psutil,pyyaml,tabulate,pymupdf-layoutandpymupdf4llmhard dependencies (1.27.1 and 1.28.2 have none). The lock shows the 2.1 wheel at about 68 MB (1.x: 24-26 MB) plus onnxruntime (about 23-28 MB) and numpy (about 16 MB) wheels. 2.1 ships 4 wheel platforms (macOS arm64, manylinux x86_64 and aarch64, win_amd64); 1.x ships musllinux, win32, win_arm64 and macOS x86_64 as well. TextSpitter only callspymupdf.open(stream=..., filetype="pdf")and page text extraction, so the ML/numeric stack is unused. 8 transitive packages dropped from the lock. Lifting the cap is a one-line change if the owner prefers 2.x.tests/test_pdf_fallback.py(6 tests) forcescore.pymupdf = Noneand checks a valid PDF (text returned), an encrypted PDF, a corrupt file and a truncated PDF (all return an empty string, no exception, error logged). A behaviour-diff ofpypdf.PdfReaderon pypdf 6.7.1 vs 7.1.1 gave identical results for valid, encrypted (FileNotDecryptedError), corrupt/truncated (PdfStreamError) and AES-256 empty-user-password inputs. Nocore.pychange needed.3.0.0and4.0.0tags), 3.0.0 was uploaded 2026-10-21 and 4.0.0 on 2026-11-01 (wheel plus sdist, not yanked, requires Python >= 3.11). It is reached only through the dev group (jupyterlab->jupyter-server->jupyter-events/arrow, andjupyter-client); nothing first-party needs it. Kept; note it is under a month old.setuptools,decoratorandnest-asynciowere only required byipykernel/ipython/jupyterlab(dev); no first-party use, and[build-system]requires onlymaturin.uv build --wheelsucceeded here (maturin Rust release build, 34 s), and the wheel installed in a clean venv importsTextSpitterandTextSpitter._core, with runtime deps pymupdf 1.28.2, pypdf 7.1.1, python-docx 1.2.0. Not verified: sdist build, non-Windows builds.astral-sh/setup-uv@v5andPyO3/maturin-action@v1with no uv or maturin version pins, so CI installs the latest uv. Norequired-versionis set. Anyone using a uv older than the one that wrote the revision-5 lock will need to upgrade.tests/test_pdf_fallback.pynow also covers the primary PyMuPDF 1.28.2 path (valid, multi-page, truncated-but-repairable, corrupt, forced PyMuPDF failure falling back to pypdf), with the pypdf fallback trapped so any use fails the test. Truncation is pinned exactly on pypdf 7.1.1: a cut inside the%%EOFmarker is recovered; losing the xref/trailer returns"". Fixture PDFs use public pypdf APIs only.cryptographyadded to the dev group (>=50.0.2, the locked version) because pypdf AES encryption needs it for the encrypted-PDF test;uv lockwas re-run without--upgrade, no locked version changed.🤖 Generated with Claude Code
https://claude.ai/code/session_017F3tye3cHFqzsJWqepu2rG