Repository navigation
fix(deps): move Pillow to 13.0.0 past fastembed's cap - #532
Merged
Merged
Conversation
fastembed 0.9.0 declares pillow<13.0, which held every image on 12.3.0 under 20 advisories. Nojoin uses only its TextEmbedding, so fastembed now installs with --no-deps from requirements/worker-no-deps.txt on every surface, worker.txt pins the rest of what it declares, and a test checks those pins against its metadata in place of pip. Fixes: #526
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.
Pull Request
Description
Moves Pillow from 12.3.0 to 13.0.0 on every surface that installs it: the API image (through
base.txt), the worker venv, the worker base's system Python, CI and the local setup. 13.0.0 is the only release with the fixes for the 20 advisories behind the 100 open alerts, andscripts/release.py's scan fails on them.fastembed 0.9.0, the newest release, declares
pillow<13.0. Nojoin uses it only forTextEmbedding, and Pillow only serves its image models. So fastembed moves out ofworker.txtinto a newrequirements/worker-no-deps.txt, which every surface installs withpip install --no-depsafterworker.txt: Dockerfile.worker, CI'sBackend testsjob, and the Fresh Checkout Setup in DEVELOPMENT.md and CONTRIBUTING.md.worker.txtnow pins the rest of what fastembed declares (onnxruntime,tokenizers,loguru,mmh3,py-rust-stemmers,tqdm), at the versions that already resolved, so no installed version other than Pillow's changes.pip no longer checks fastembed's requirements, so
backend/tests/test_no_deps_requirements.pydoes. It fails when something fastembed declares is unpinned or pinned outside its range, whenworker.txtis installed without the--no-depsstep, and once fastembed accepts the pinned Pillow, so the arrangement is undone on the fastembed bump that makes it unnecessary. The worker image build also imports fastembed in the runtime stage, which loads every dependency it declares. Thepillow >=13.0.0ignore independabot.ymlis gone. Thehuggingface-hubhold stays, now enforced by the test rather than by pip.Upstream: qdrant/fastembed#830 raises the cap to
<14.0. It has been open since 19 October with no maintainer response, and no release is scheduled, so this does not wait for it.New dependencies: none. The six pins above were already installed through fastembed.
Fixes #526
Decision record
--no-depsfor fastembed, chosen. Smallest change, and the embedding code path is fastembed's own, so vectors cannot drift. The cost is a second install line on four surfaces, with the test standing in for pip's check.override-dependencieswould do it, but every surface installs with pip.onnxruntimepinned at 1.31.0, matching the image'sonnxruntime-gpu. It used to arrive unpinned through fastembed. The comment asks for the two to move together.Image.open,convert,new,resize(LANCZOS), PNG save,ImageFont.truetypeandImageDrawprimitives with anchors, none of which changed. reportlab, matplotlib, python-pptx, pytesseract and torchvision declare only lower bounds. fastembed's one affected call,Image.fromarray(..., mode="RGB")on uint8 data, still works in 13 and sits in the image path Nojoin never runs.Type of change
Checks run
python scripts/check.py(Ruff, format, whitespace and other gates, mypy, doc and Alembic validators, pytest). 2975 passed with the Postgres-gated tests, in a test image built on the worker image with fastembed and its own dependencies uninstalled first, then reinstalled through Dockerfile.worker's builder steps.python3 scripts/validate_docs.py, pluscheck_whitespace.py,check_file_size.py,check_held_pins.py --offlineandgit diff --checkon the host.Migration impact
Documentation impact
Security impact
Manual verification
pip install --dry-runoftest.txtandlint.txtonpython:3.12-slimresolves 219 packages with Pillow 13.0.0 and no fastembed in the resolve, and the--no-depsline installs fastembed after it.TextEmbeddingServiceon the CPU with Pillow 12.3.0 and with 13.0.0. The vectors are bit-identical (largest difference 0.0), so stored embeddings stay valid andTEXT_EMBEDDING_VERSIONdoes not move.ocr_imageson rendered pages as an RGBA PNG, an L-mode JPEG and a P-mode GIF returns the same text on both versions.Not run: GPU inference and the live stack, which this change does not touch beyond the rebuild.
Follow-ups: #529 (PDF parsing imports PyMuPDF as the deprecated
fitz), #531 (certifi and uv in the worker base).