Skip to content

fix: narrow Python support and remove Mistral extra#183

Open
StijnGoossens wants to merge 5 commits into
mainfrom
fix/python-support-upper-bound
Open

fix: narrow Python support and remove Mistral extra#183
StijnGoossens wants to merge 5 commits into
mainfrom
fix/python-support-upper-bound

Conversation

@StijnGoossens
Copy link
Copy Markdown
Collaborator

@StijnGoossens StijnGoossens commented May 12, 2026

This PR fixes multiple CI failures:

  • Narrows the declared Python support range from <4.0 to <3.14.
  • Removes the mistral-ocr extra because mistralai is currently unavailable/quarantined on PyPI, causing uv sync --all-extras to fail. The Mistral OCR integration still lazy-imports mistralai; users who need the feature are instructed to install mistralai directly.
  • Fixes the lint failure from the pre-commit mypy hook. Pre-commit was passing Python files to mypy in small batches, which triggered mypy internal errors in the highest-resolution CI jobs. The hook now runs one project-level check with mypy src tests and disables filename passing, so mypy sees the full source/test graph in one invocation. The tradeoff is that local mypy pre-commit runs now always check src and tests, though in this repo the single full-project run is still only a few seconds.

The highest-resolution CI lint jobs selected mypy 2.1.0 and failed during the pre-commit mypy hook with an internal error, even though nearby chunks reported "Success: no issues found". Exclude that specific mypy release so highest-resolution jobs resolve to a non-crashing version while preserving future mypy updates.
The CI lint failure was not limited to one mypy release: highest-resolution jobs crashed with mypy 2.1.0 and then 2.0.0, and local pre-commit also reproduced an internal error with mypy 1.20.1. In each failure, pre-commit had split the hook into several 4-file mypy invocations.\n\nRun mypy once over src and tests, and disable filename passing for the hook. This matches the direct project-level mypy invocation, which passes across the tested mypy versions, and avoids chunked partial graph analysis/cache/report interactions.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses CI failures by tightening the declared Python compatibility range, removing an optional dependency extra that can’t currently be resolved from PyPI, and adjusting the pre-commit mypy hook to run a single full-project type check.

Changes:

  • Narrow Python requirement in pyproject.toml from <4.0 to <3.14.
  • Remove the mistral-ocr optional-dependency extra and update docs/error messages to instruct direct installation of mistralai.
  • Update the pre-commit mypy hook to run mypy src tests with pass_filenames: false to avoid batch-related mypy failures.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/raglite/_mistral_ocr.py Updates ImportError guidance for missing mistralai.
README.md Updates installation instructions for Mistral OCR and minor dev-env wording.
pyproject.toml Narrows Python version range and removes the mistral-ocr extra.
.pre-commit-config.yaml Runs a single project-level mypy check to avoid CI failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread src/raglite/_mistral_ocr.py
Comment thread src/raglite/_mistral_ocr.py Outdated
Keep the mistral-ocr extra as an empty compatibility placeholder so existing raglite[mistral-ocr] install commands keep resolving without pulling the quarantined mistralai package through --all-extras. Also clarify lazy-import errors so users know an incompatible installed mistralai version may need upgrading, not just installation.
@StijnGoossens StijnGoossens requested a review from lsorber May 12, 2026 14:43
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.

2 participants