Skip to content

Test markitdown-ocr in CI against the sibling markitdown - #2378

Merged
Adam Fourney (afourney) merged 5 commits into
mainfrom
prepare_release
Sep 4, 2026
Merged

Adam Fourney (afourney) merged 5 commits into
mainfrom
prepare_release

Conversation

@afourney

Copy link
Copy Markdown
Member

packages/markitdown-ocr has never run in CI — tests.yml only runs
cd packages/markitdown; hatch test. Its suite fails 4 of 40 locally,
from two causes.

Add an ocr-tests job. Three docx failures come from the test env
resolving markitdown from PyPI (0.1.7) instead of the sibling checkout
(0.1.8b1), which has the underline (#2017) and ZIP casing (#2016) fixes
those tests exercise. The job installs ./packages/markitdown as a local
path so the checkout wins the requirement and nothing comes from PyPI.

Fix a stale test_pdf_multipage snapshot. It asserted full-page OCR
fallback, on the claim that pdfplumber can't open the file. It can —
pdf_multipage.pdf is valid and opens on every pdfminer.six from 20231228
on — so the converter interleaves page text with the OCR blocks. The
expectation now matches that.

Also included, already staged: spacing in the --cu-endpoint error
message, and skipping the XML round-trip in _pre_process_strike when
there are no dstrike elements.

40 passed on Python 3.12; the 3.10/3.11 matrix legs are unverified locally.

Follow-up: this tests the workspace markitdown, not what installers get —
pip install markitdown-ocr still resolves 0.1.7 and silently drops <u>.
The floor should move to markitdown>=0.1.8 once it ships.

🤖 Generated with Claude Code

Add an ocr-tests job that installs markitdown from the local checkout
rather than PyPI, so the plugin is exercised against the sibling package
it ships alongside. The docx underline and ZIP filename casing tests
depend on fixes that are not in the released 0.1.7, so hatch's env made
them fail.

Also correct the test_pdf_multipage expectation: pdf_multipage.pdf parses
fine on every supported pdfminer.six, so the converter interleaves page
text with the OCR blocks rather than falling back to full-page OCR.

Includes two unrelated fixes that were already staged: spacing in the
--cu-endpoint error message, and skipping the XML round-trip in
_pre_process_strike when the document has no dstrike elements.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@afourney
Adam Fourney (afourney) requested a balanced review from Copilot September 4, 2026 02:53
Comment thread .github/workflows/tests.yml Fixed
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The CI matrix omits Python 3.13 despite the package explicitly advertising support for it.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds CI coverage for markitdown-ocr against the sibling markitdown checkout and updates related behavior.

Changes:

  • Adds multi-version OCR test CI.
  • Updates the multipage PDF snapshot.
  • Optimizes DOCX strike preprocessing and fixes CLI error spacing.
File summaries
File Description
.github/workflows/tests.yml Adds OCR CI and read-only permissions.
packages/markitdown-ocr/tests/test_pdf_converter.py Updates multipage PDF output expectations.
packages/markitdown/src/markitdown/converter_utils/docx/pre_process.py Skips unnecessary XML processing.
packages/markitdown/src/markitdown/__main__.py Corrects error-message spacing.
Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/tests.yml Resolved
@afourney
Adam Fourney (afourney) merged commit bc90c5d into main Sep 4, 2026
13 checks passed
@afourney
Adam Fourney (afourney) deleted the prepare_release branch September 4, 2026 03:28
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.

3 participants