Skip to content

chore(deps): refresh uv.lock (replaces Dependabot bumps) - #31

Open
fsecada01 wants to merge 4 commits into
mainfrom
chore/uv-lock-refresh-20261120
Open

fsecada01 wants to merge 4 commits into
mainfrom
chore/uv-lock-refresh-20261120

Conversation

@fsecada01

@fsecada01 fsecada01 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

What

One uv lock --upgrade refresh of uv.lock, replacing the individual Dependabot bumps. 96 packages changed, 2 added (jupyter-builder, nest-asyncio2); decorator, nest-asyncio and setuptools dropped (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.0b1 line is only the project's own version being recorded in the lock (pyproject already says 2.0.0b1).

Functionality checks

  • PDF extraction: core.py opens PDFs with pymupdf.open(stream=..., filetype="pdf") and falls back to pypdf.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).
  • No code change was needed. pymupdf is held below 2 (1.27.1 -> 1.28.2 in the lock); see Review follow-ups.

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 --check reports 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, logging extra, dev group; 20 specs) now has a lower bound equal to its locked version, because uv.lock is built from pyproject.toml. Only requires-dist metadata and the pymupdf hold changed in the lock; uv lock --check passes. No == pins exist.

  • pymupdf capped >=1.28.2,<2 (owner decision). pymupdf 2.1 makes networkx, numpy, onnxruntime, psutil, pyyaml, tabulate, pymupdf-layout and pymupdf4llm hard 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 calls pymupdf.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.
  • pypdf 7 fallback path. New tests/test_pdf_fallback.py (6 tests) forces core.pymupdf = None and 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 of pypdf.PdfReader on 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. No core.py change needed.
  • python-dateutil 4.0.0. Genuine upstream: PyPI project links to github.com/dateutil/dateutil (active repo with 3.0.0 and 4.0.0 tags), 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, and jupyter-client); nothing first-party needs it. Kept; note it is under a month old.
  • Dropped packages. setuptools, decorator and nest-asyncio were only required by ipykernel/ipython/jupyterlab (dev); no first-party use, and [build-system] requires only maturin. uv build --wheel succeeded here (maturin Rust release build, 34 s), and the wheel installed in a clean venv imports TextSpitter and TextSpitter._core, with runtime deps pymupdf 1.28.2, pypdf 7.1.1, python-docx 1.2.0. Not verified: sdist build, non-Windows builds.
  • uv.lock revision 3 -> 5. The workflows use astral-sh/setup-uv@v5 and PyO3/maturin-action@v1 with no uv or maturin version pins, so CI installs the latest uv. No required-version is set. Anyone using a uv older than the one that wrote the revision-5 lock will need to upgrade.
  • Round 2 tests. tests/test_pdf_fallback.py now 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 %%EOF marker is recovered; losing the xref/trailer returns "". Fixture PDFs use public pypdf APIs only.
  • cryptography added to the dev group (>=50.0.2, the locked version) because pypdf AES encryption needs it for the encrypted-PDF test; uv lock was re-run without --upgrade, no locked version changed.
  • Owner decision: runtime floors are raised to the locked versions, per the owner's instruction. This can make dependency resolution stricter for downstream users of this published library; older floors would be friendlier. Floors were deliberately left unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_017F3tye3cHFqzsJWqepu2rG

fsecada01 and others added 3 commits November 20, 2026 20:21
…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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant