Skip to content

fix: add numba>=0.61 floor so PyPI installs resolve - #4

Closed
mainpart wants to merge 2 commits into
KalebJS:mainfrom
mainpart:fix/numba-floor-for-pypi-resolution
Closed

mainpart wants to merge 2 commits into
KalebJS:mainfrom
mainpart:fix/numba-floor-for-pypi-resolution

Conversation

@mainpart

@mainpart mainpart commented Jul 21, 2026 •

Copy link
Copy Markdown

Problem

pip install whispermlx and uv tool install whispermlx currently fail on every supported Python version:

RuntimeError: Cannot install on Python version 3.13.12; only versions >=3.6,<3.10 are supported

help: `llvmlite` (v0.36.0) was included because `whispermlx` (v3.12.2)
      depends on `mlx-whisper` (v0.4.3) which depends on `numba` (v0.53.1)

Root cause

mlx-whisper declares numba with no lower bound. Resolving from published metadata, numpy floats to 2.5.1, while modern numba caps it at <2.5. The resolver reconciles that by backtracking numba rather than numpy — all the way to 0.53.1, a 2021 release predating the cap entirely. That version pulls llvmlite 0.36, whose setup.py hard-fails on any Python >=3.10.

Reproducible with just the two packages:

$ echo whispermlx | uv pip compile --python-version 3.12 - -o /dev/null
numba==0.53.1
llvmlite==0.36.0

$ echo mlx-whisper | uv pip compile --python-version 3.12 - -o /dev/null
numba==0.66.0
numpy==2.4.6

mlx-whisper alone resolves fine — it's the wider dependency graph that gives numpy enough weight to win the ordering.

Why CI is green

Both jobs in python-compatibility.yml install via uv sync, which reads uv.lock. The lockfile already pins a working numba 0.64.0 / numpy 2.2.6, so the broken resolution never runs in CI. It only happens from published metadata, which is exactly what end users get.

Changes

  1. numba>=0.61 floor in dependencies — 0.61 is the first release supporting modern numpy and Python 3.13. Comment explains the constraint so it isn't dropped as mysterious later.
  2. install-from-metadata CI job — builds the wheel and installs it from a temp directory outside the project tree, where neither uv.lock nor [tool.uv] settings apply. This is the job that would have caught the bug.

Verification

Clean 3.13 venv, patched wheel, installed from outside the project:

Resolved 109 packages in 6.60s
 + llvmlite==0.48.0
 + numba==0.66.0
 + numpy==2.4.6

numpy<2.5 works identically as a constraint if you'd prefer expressing it that way — I went with the numba floor since numba is the package that actually needs bounding.

Summary by CodeRabbit

  • Bug Fixes
    • Improved installation compatibility by adding a direct numba>=0.61 requirement to avoid issues with NumPy/Python compatibility.
  • Tests
    • Added an automated CI check that builds the wheel and installs it from outside the repository to ensure real downstream installation behavior.
    • Verified key imports after installation on macOS for Python 3.10 and 3.13.

mlx-whisper declares `numba` with no lower bound. When resolving from
published metadata, numpy floats to >=2.5 while modern numba caps it at
<2.5, so the resolver backtracks numba to 0.53.1 -- a 2021 release that
predates the cap entirely. That drags in llvmlite 0.36, whose setup.py
hard-fails on any Python >=3.10:

    RuntimeError: Cannot install on Python version 3.13.12;
    only versions >=3.6,<3.10 are supported

So `pip install whispermlx` / `uv tool install whispermlx` fails on every
Python this project supports.

CI misses it because both jobs install through `uv sync`, which reads
uv.lock -- and the lock already pins a working numba 0.64.0 / numpy 2.2.6.
The broken resolution only happens from published metadata.

Fixes:
- pin numba>=0.61 (first release supporting modern numpy and Python 3.13)
- add an install-from-metadata CI job that builds the wheel and installs
  it outside the project tree, where neither uv.lock nor [tool.uv]
  settings apply -- the same inputs a PyPI user gets

Verified on a clean 3.13 venv from the built wheel:
llvmlite 0.48.0, numba 0.66.0, numpy 2.4.6.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b68b0c1f-8d2d-45da-a9b7-26426a24a504

📥 Commits

Reviewing files that changed from the base of the PR and between 94a2362 and 6090991.

📒 Files selected for processing (1)
  • .github/workflows/python-compatibility.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/python-compatibility.yml

📝 Walkthrough

Walkthrough

The project directly requires numba>=0.61 and adds CI coverage that installs the built wheel outside the repository and verifies imports on Python 3.10 and 3.13.

Changes

Compatibility validation

Layer / File(s) Summary
Dependency resolution constraint
pyproject.toml
Adds numba>=0.61 and documents related mlx-whisper transitive resolution behavior.
External wheel installation check
.github/workflows/python-compatibility.yml
Builds and installs the wheel in a temporary external environment, then verifies imports for whispermlx, numba, and llvmlite on Python 3.10 and 3.13.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a numba floor to fix PyPI installation resolution.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/python-compatibility.yml (1)

73-73: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Exercise the dependency runtime path, not only the package root.

whispermlx lazily imports its implementation modules, so import whispermlx alone can pass without loading the Numba/llvmlite stack. Import those dependencies explicitly in this metadata-install job to catch runtime incompatibilities earlier. (github.com)

Suggested smoke-test expansion
-          uv run --no-project python -c "import whispermlx; print('Successfully imported whispermlx')"
+          uv run --no-project python -c "import whispermlx, numba, llvmlite; print('Successfully imported whispermlx, numba, and llvmlite')"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/python-compatibility.yml at line 73, Expand the smoke-test
command in the dependency metadata-install job to explicitly import the Numba
and llvmlite runtime dependencies in addition to whispermlx. Keep the
successful-import message and ensure the command exercises those dependency
modules rather than only the lazy package root import.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/python-compatibility.yml:
- Line 73: Expand the smoke-test command in the dependency metadata-install job
to explicitly import the Numba and llvmlite runtime dependencies in addition to
whispermlx. Keep the successful-import message and ensure the command exercises
those dependency modules rather than only the lazy package root import.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 028e1279-adbd-410f-b38e-e877f00abedb

📥 Commits

Reviewing files that changed from the base of the PR and between 8f108ee and 94a2362.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • .github/workflows/python-compatibility.yml
  • pyproject.toml

whispermlx imports its implementation modules lazily, so `import whispermlx`
loads neither numba nor llvmlite — verified, it pulls 5 modules and none of
them are the ones this job guards.

Does not change what this job catches for the numba case (that one fails
during the llvmlite build, before any import), but it covers the adjacent
failure mode where a wheel installs cleanly and the shared library will not
load.

Thanks @coderabbitai for the catch.
@mainpart

mainpart commented Jul 21, 2026 •

Copy link
Copy Markdown
Author

Good catch on the lazy imports — verified it locally:

import whispermlx  →  5 modules loaded
numba loaded:     False
llvmlite loaded:  False
torch loaded:     False

Applied in 6090991.

It doesn't change what this job catches for the numba case specifically (that one fails during the llvmlite build, before any import runs), but it covers the adjacent failure mode where a wheel installs cleanly and the shared library then refuses to load.

That mode is not hypothetical here, incidentally. torchcodec has the same shape of problem as numba: [tool.uv] override-dependencies pins it to >=0.6.0,<0.8.0, that pin does not reach published metadata either, and a PyPI install lands on 0.15.0 — which is ABI-incompatible with the pinned torch 2.8:

OSError: dlopen(.../torchcodec/libtorchcodec_core8.dylib): Symbol not found: _aoti_torch_aten_full

Installation succeeds; the failure only appears at import. Happy to add torchcodec>=0.6.0,<0.8.0 to dependencies here as a second commit, or file it separately — your call which you'd prefer.

@KalebJS KalebJS left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

looks overall good, and builds properly. resolve those comments and we can merge.

Comment on lines +41 to +44
# The job above installs from uv.lock, so it never exercises the resolution
# a downstream `pip install whispermlx` actually performs. This one builds
# the wheel and installs it from outside the project tree, where neither the
# lockfile nor [tool.uv] settings apply — the same inputs PyPI users get.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

remove explanatory comment

Comment thread pyproject.toml
Comment on lines +14 to +19
# mlx-whisper depends on numba without a lower bound. Resolving from
# published metadata, numpy floats to >=2.5 and numba (capped at
# numpy<2.5) is backtracked to 0.53.1, which pulls llvmlite 0.36 and
# fails to build on Python >=3.10. 0.61 is the first release supporting
# modern numpy and Python 3.13.
"numba>=0.61",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

remove explanatory comment

@KalebJS KalebJS closed this Aug 7, 2026
@KalebJS

KalebJS commented Aug 7, 2026

Copy link
Copy Markdown
Owner

No action taken as a result of response-I just implemented your changes myself. Thanks for surfacing the issue and identifying a solution!

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