Skip to content

Allow Pillow 11 and 12 (relax pillow<11 to pillow<13)#519

Open
gkriegspeedbay wants to merge 1 commit into
datalab-to:masterfrom
gkriegspeedbay:pillow-bound-bump
Open

Allow Pillow 11 and 12 (relax pillow<11 to pillow<13)#519
gkriegspeedbay wants to merge 1 commit into
datalab-to:masterfrom
gkriegspeedbay:pillow-bound-bump

Conversation

@gkriegspeedbay

Copy link
Copy Markdown

What

Relax the Pillow upper bound: pillow>=10.2.0,<11pillow>=10.2.0,<13 (admits Pillow 11 and 12).

Why

The <11 ceiling looks precautionary rather than code-driven. surya already uses the modern Pillow API throughout — Image.Resampling.LANCZOS/BILINEAR, resize/thumbnail, ImageDraw, ImageFont.truetype, ImageOps — and none of the APIs removed in Pillow 10/11 (Image.ANTIALIAS, ImageDraw.textsize, ImageFont.getsize, …). A tree-wide grep for the removed/changed-in-11 symbols found no uses.

This also unblocks downstream consumers (e.g. marker-pdf) whose security updates are gated by surya-ocr's transitive pillow<11 pin. Refs #464.

Testing

Full test suite passes with Pillow 12.2.0 on both transformers 4.57.6 and 5.12.0 (Python 3.11, CPU): test_detection, test_layout, test_recognition, test_table_rec, test_ocr_errors.

🤖 Generated with Claude Code

The `pillow<11` ceiling is precautionary, not code-driven: surya already
uses the modern Pillow API throughout (Image.Resampling.LANCZOS/BILINEAR,
resize/thumbnail, ImageDraw, ImageFont.truetype, ImageOps) and none of the
APIs removed in Pillow 10/11 (Image.ANTIALIAS, ImageDraw.textsize,
ImageFont.getsize, etc.). Widening to <13 admits Pillow 11 and 12.

This also unblocks downstream consumers (e.g. marker-pdf) whose own CVE
remediation is gated by surya-ocr's transitive `pillow<11` pin. See datalab-to#464.

Verified: full test suite passes with Pillow 12.2.0 on both transformers
4.57.6 and 5.12.0 (detection, layout, recognition, table_rec, ocr_error).
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@gkriegspeedbay

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 13, 2026
@gkriegspeedbay

Copy link
Copy Markdown
Author

Heads-up for whoever reviews: this pairs with #520 (transformers 5.x / huggingface-hub 1.x). The two relaxations are complementary — #519 alone still leaves huggingface-hub<1 (which transformers 5 can't satisfy), and #520 alone still leaves pillow<11. Both are needed together before a downstream consumer like marker-pdf can widen its own ceilings. Happy to squash them into a single PR if that's easier to review — whatever you prefer.

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