Skip to content

chore: drop unused ocr extra (resolves torch bump PR #2129) - #2156

Closed
robbrad wants to merge 1 commit into
masterfrom
chore/remove-unused-ocr-extra
Closed

robbrad wants to merge 1 commit into
masterfrom
chore/remove-unused-ocr-extra

Conversation

@robbrad

@robbrad robbrad commented Jul 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • build(deps): bump torch from 2.9.0 to 2.12.0 #2129 (dependabot bump: torch 2.9.0 → 2.12.0) has been stuck since it was opened - resolving the lock file touches ~24 interlocking nvidia/cuda transitive packages and the PR is now conflicting with master.
  • Investigated why torch is even a dependency: it's pulled in transitively by easyocr, which was only ever used by SouthKestevenDistrictCouncil's old OCR-based scraper. That scraper was fully replaced by Fix South Kesteven binday scraper #2121's rewrite - grepped the whole codebase and nothing imports easyocr or torch anymore.
  • Rather than fight the version-bump resolution for a dependency nothing uses, this removes the ocr extra (easyocr, pillow) entirely and regenerates poetry.lock, which drops torch and the full nvidia/cuda chain with it (net -897 lines in the lock file).

Once this merges, #2129 becomes moot (torch will no longer be a dependency at all) and can be closed.

Side effect

No council or HA behaviour changes at all - nothing in the codebase used easyocr/torch. The only way this could affect anyone is if someone has pip install uk_bin_collection[ocr] pinned somewhere outside this repo; that install would start failing with "extra not found" after this merges. Given the extra was already dead weight (its sole consumer was removed by #2121), this seems very unlikely to affect anyone in practice.

Test plan

  • poetry run pytest uk_bin_collection/tests custom_components/uk_bin_collection/tests --ignore=uk_bin_collection/tests/step_defs/ - 221 passed
  • Confirmed no remaining references to easyocr/torch/the ocr extra anywhere in the codebase, CI workflows, or docs

Summary by CodeRabbit

  • Chores
    • Updated the project’s PDF extraction dependency configuration.
    • No user-facing functionality changes.

SouthKestevenDistrictCouncil's OCR-based scraper (the only consumer of
the ocr extra) was fully replaced by #2121's rewrite - nothing in the
codebase imports easyocr or torch anymore. Removing the extra drops
easyocr, pillow, and the ~24 interlocking nvidia/cuda transitive
packages that came with it, and makes the pending torch version-bump
PR (#2129) unnecessary.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Poetry dependency list is reorganized so pdfplumber remains declared at version ^0.11.9 in a new position relative to the optional OCR dependencies.

Changes

Dependency declarations

Layer / File(s) Summary
Reposition pdfplumber dependency
pyproject.toml
Moves the pdfplumber declaration to a new location in the Poetry dependency list and adjusts the adjacent OCR-related dependency block.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: removing the unused ocr extra and related dependency cleanup.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-unused-ocr-extra

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.88%. Comparing base (0f279e2) to head (2ce0d77).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2156   +/-   ##
=======================================
  Coverage   86.88%   86.88%           
=======================================
  Files           9        9           
  Lines        1159     1159           
=======================================
  Hits         1007     1007           
  Misses        152      152           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@robbrad

robbrad commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Folded into #2155 to keep this release to a single follow-up PR. Closing this one - the commit is now part of #2155's branch.

@robbrad robbrad closed this Jul 13, 2026
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